[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Catching interpreter errors?
On Sun, Aug 28, 2005 at 05:28:55PM +0200, Mario Lang wrote:
> Function-try is nice for catching all sorts of errors, however, while experimenting
> I found that it does *not* catch interpreter errors:
>
> {"bl".interpret}.try(_.errorString);
>
> Is there a way to catch errors like "ERROR: Variable 'bl' not defined."?
hey, i stepped into the same trap a while ago. interpret
doesn't throw an exception but returns nil on error.
a partial solution would be to have Process.compile throw an
exception instead of returning nil, but then the error would
still be printed. as a real fix, the primitive could stuff
the error message into a variable, e.g. lastCompileError,
which the exception then can access.
<sk>