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

[REBOL] Re: Trapping an error

From: SunandaDH:aol at: 7-Nov-2003 10:37

> HELP-FILENAME: %YYYYY ;;; set default value > do %config.r ;;; override default value > > This works just fine EXCEPT if I put an incorrectly-formatted file name > in the configuration file. If the file name in the configuration file > is bad, then when I "do" that file the script crashes.
Maybe I'm missing the point here, but... if error? capture-error: try [do %config.r] [ print ["Whoops! " mold disarm capture-error] ] ...should do the trick There are some REBOL errors that crash the interpretor entirely and don't get trapped, but a badly formed file name shouldn't be one as far as I know. Just for interest, one such error (it'll crash REBOL) is: aa: make object! [] bb: make object! aa The second line should be: bb: make aa [] Sunanda.