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

[REBOL] Re: UNTRAPPABLE ERROR!

From: sanghabum:aol at: 27-Jun-2001 13:41

[chris--starforge--demon--co--uk]:
> I think what you're doing is making a fatal assumption about the nature > of errors in REBOL. REBOL can't do the same thing as, say, a C compiler > otherwise it could report the /lines/binary error before the script even > started. gcc can pick up things like "too many arguments" problems > during the compilation process but REBOL interprets on the fly - it > can't do that
Hi Chris, I appreciate the analysis of Mark's reported problem. But I would like *all* errors to be trapped. Below is my "standard application wrapper" (shorn of error logging/reporting, restart code, etc). The idea is that the user never gets dumped into the Console no matter how bad the code I've foisted on them. Rebol [] Forever [ APPLICATIONERROR: copy [] If error? APPLICATIONERROR: try [ do %application.r ][ ALERTSTATUS: alert [join "It's fallen over!!!" [ "Please make a note of " "the cryptic stuff below and send it to ..., Thanks. " "=======================" mold disarm APPLICATIONERROR "=======================" ] ; join "Restart" "Exit" ] ; alert if not ALERTSTATUS [quit] ] ; if ] ; forever This code catches the situation where Application.r doesn't exist...But it won't catch the sort of Interpretor/Runtime errors that you describe. I know they shouldn't be there but if they are, it'd be nice not to need another error reporting mechanism. --Colin.