> The following block construct seems to work to
> catch errors from the interpreter:
> ;======================================
> if error? set/any 'err
> try
> [ "Good Code Block"
>   x: "a" + 1
> ]
> [ "Error Block"
>   err: disarm err
>   print reform bind (get in (get in system/error err/type) err/id) in err
> 'type
> ]
> Two questions arise from this
> 1)Are there associated error numbers that I can trap and 
>   thus change the syntax of the error message itself?

Understand not fully. the reis [code: 800] or that in the
error-object, but trapping?!
But, look at that:

>> catch [print 123 throw 'bum print 234]
123
==  bum  ;  word!
this way you have not to deal with "dangerous" 'error! . Dangerous? :
 
> 2)Is there a way in which I can explicitly force control to
>   be transferred to "Error Block", with an attendant error message.
> I have looked at docs for "throw" and don't find a clear answer
> there.

>> try [123 make error! "bum" 234]             
** User Error: bum.
** Where: make error! "bum"

as you can see, having an "armed" error throws it!

> 
> Thanks
> Tim
> 

Volker

Reply via email to