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

[REBOL] Trapping errors? - Not like the book says? Re:

From: rebol:techscribe at: 3-Aug-2000 10:51

Hi Douglas, 1. to correct that problem use set/any 'error try [...] 2. Why don't you join the REBOL ... Guide mailing list? I think that will be a better forum for discussing book related issues, so as not to waste the bandwidth for people who haven't bought the book. 3. BTW, the RTOG list is open to anyone, whether they've bought the book or not (in case you want to monitor the discussions there, to decide if the book is something that may come in handy.) You can sign up for the list http://www.TechScribe.com Hope this helps, At 10:06 AM 8/3/00 -0400, you wrote:
>I have read and re-read the sections >REBOL the official guide. about errors. >(eg. pages 276 and following) > >Then I put together a function to log errors called log-event (with a >refinement for handling disarmed error objects). >The log-event function will then log the date, time, script name, "error", >and molded error object. > >if error? error: try [send [joe--blow--go--go] {test} ][ ; >this will probably force an error > log-event/error system/script/header/file "error" (disarm error) ; >since go.go is not a valid domain > ] > >It works great if there is an error, >however, if there is not an error, you get this other error message.--> > >if error? error: try [send [doug--vos--eds--com] {test} ][ ; this will >probably NOT force an error > log-event/error system/script/header/file "error" (disarm error) ; and >I'll get your test message > ] > >** Script Error: error needs a value. >** Where: if error? error: try [ send [doug--vos--eds--com] {test} ] > >Because error does not receive a value when it >interprets " error: try " -- since there is not an error. > >So then I tried... > >if error? error: try [send [joe--blow--gogogo--com] {test} (disarm error) ][ >; not in the book, but I was just trying stuff > log-event/error system/script/header/file "error" (disarm error) > ] > >This is bad because the script runs for a while but it is constantly >disarming error that never really occured.... > >This sort of works but fills up my log file with junk and then >eventually the program crashes with a garbage collection error. > >Douglas Vos - EDS/GM-BSU Webmaster >e-Mail: mailto:[doug--vos--eds--com] >
;- Elan [ : - ) ] author of REBOL: THE OFFICIAL GUIDE REBOL Press: The Official Source for REBOL Books http://www.REBOLpress.com visit me at http://www.TechScribe.com