Re: A83: Error handlers [83]


[Prev][Next][Index][Thread]

Re: A83: Error handlers [83]




In accordance with the prophecy, Henk Poley uttered:

> I think this subject is interesting, more because I didn't find much about
> it. Only some document saying that it is possible to install a 'new
> error-handler'. Okay...
> 
> What does that error handler do? (besides giving a "ERR:xxx" message)
> And how can you change the behaviour?
> 
> Most Ion-games which are *smart* enough to do error-trapping come up with
> an error-message, after wich I can return to the prompt to see that my calc
> has crashed... Not quite the way I want it to be.
> 
> Most of those errors are merely because a misuse of numbers.
> Such as, trying to do a _SIN call on a negative number in OP1. Okay, the
> programmer certainly want's to know if this happens. But I think every
> program should be able to react in it's own ways, sometimes such error
> aren't that serious...
> 
>       Henk Poley

It works like try/catch in java.

try {                pushErrorHandler

...

}                    popErrorHandler
catch( ... )
{ ... }              the code you install as an error handler.

Linus
---------------------------------------------------------------------------
They're not suicidal. They just think they can fly.
-- Donna Lypchuk, on Cats that jump off balconies




References: