Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Coerting Errors to a string?

From: philb:upnaway at: 21-Dec-2001 11:02

Thanks Volker, I will use this in my error handling The next question is am I handling my errors correctly? For Example if error? lv-err: try [1 / 0] [Print "Error"] ; works if error? lv-err try [1 / 2] [Print "Error"] ; works However if error? lv-err try [Print "AAA"] [Print "Error"] ; does not work gives AAA ** Script Error: lv-err needs a value ** Near: if error? lv-err: try [Print "AAA"] Cheers Phil === Original Message === RE: [REBOL] Coerting Errors to a string? (original by Bo somewhere, called print-error. forgot if i changed something.) form-error: func [ error [object!] /local arg1 arg2 arg3 message out ] [ out: make string! 100 set [arg1 arg2 arg3] [error/arg1 error/arg2 error/arg3] message: get in get in system/error error/type error/id if block? message [bind message 'arg1] append out reform reduce message append out reform ["^/Near:" mold error/near] append out reform ["^/Where:" mold get in error 'where] ] use with [print form-error disarm error] -Volker [philb--upnaway--com] wrote: