Kai,

Tim is correct, you have to be more careful
handling errors. Example, this is not enough
to trap the error:

        my-error: try [1 / 0]  disarm my-error

In the first expression above, the set-word
looks for a value, and gets an error from TRY.
The result returned is the value of the set-word,
which is the error, so it is left to "explode".

You can do this:

        disarm my-error: try [...]

but that assumes that there always will be an error.
It will fail when your code does not make an error:

        disarm my-error: try [print 100]

So a way that handles all errors and normal return values
is:

        if error? set/any 'my-error try [...][
                print mold disarm my-error
        ]

Yes, it is quite wordy, but it's possible to refactor
into helper functions, as Ladislav has done.

Regards,

Anton.

> Tim ~ There is a disarm (right below the probe... line)
> 
> If I only knew how to tame my mailer...!!
> 
> Kai

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to