[DGD] Fw: Re: callout cantrip

bart at wotf.org bart at wotf.org
Wed Mar 18 01:24:17 CET 2009


Well, that idea seems to work quite well..

a=2; 
b=0; 
catch { 
  return a/b; 
} : { 
  write(caught_error(1)); 
}


when called causes:

[CAUGHT] Division by zero
Object: /std/user#62, program: /std/user, line 187
 187 receive_message   /std/user (#62)
 182 _receive_message  /std/user (#62)
 675 receive_message   /std/player (#79)
  23 main              /cmds/wiz/eval
  10 exec              /tmp/aidil

Code is in the latest gurbalib distribution and in subversion of course.

On Sat, 14 Mar 2009 16:02:48 +0100, bart wrote
> Talking about such 'tricks', I've been pondering saving a copy of the
> call_stack or an 'interpreted version' of it in a tls var when 
> encountering a caught runtime error so one can rethrow it and 
> provide a proper trace of the caught error.
> 
> Bart.

--
Created with Open WebMail at http://www.bartsplace.net/
Read my weblog at http://soapbox.bartsplace.net/




More information about the DGD mailing list