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

[REBOL] Re: Error!

From: tim:johnsons-web at: 25-Oct-2001 20:18

On Thu, Oct 25, 2001 at 09:15:15PM -0700, Ammon Johnson wrote:
> Hi, > > There has got to be away to change the default error handling rutine, what is? One of you guys (or gals) surely knows what it is. I guess really what I am looking for is the word to set, after all, there are NO RESERVED WORDS, right? > > Thanks!! > Ammon
Hi Ammon: I'm not sure if I understand your question completely but: Here's what I do. 1)A (slightly) customized error maker 2)An error handling routine 3)A try-catch style template Error maker ========== ;############################################################################################## ; toss: Simple error-reporting function. Takes a block to aid message formatting ; ############################################################################################ toss: func[err-message[block!]][make error! rejoin err-message] ; ;Error Handling routine: this is included in the rebol.org script library ======================================================================== Author: "Bohdan Lechnowsky" ;############################################################################ ; print-error: Bo's error trapper ; ########################################################################### print-error: func[ error [object!] /local arg1 arg2 arg3 message out ][ print "<pre>" print rejoin ["======>ERROR:"] 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 error/where] print out ] ; ;try-catch style temple application: [; execution block ; code here ] salvage:[print-error disarm err cgi/cls] if error? set/any 'err try application salvage HTH
> > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com