[R] interaction of options(error=) and try()
Vadim Ogranovich
vograno at arbitrade.com
Tue Jan 7 19:50:03 CET 2003
Dear R-Users,
I am somewhat confused by the interplay between options(error=) and try(). I
set my error handler to an expression that dumps the frames and quits. Yet,
I thought that this handler would NOT be invoked if an error happens within
try(). Apparently it was. Here is the code that I ran as R BATCH:
options(error=quote({dump.frames("t.dump", to.file=TRUE); q()}))
try({ stop("error in try") })
cat("OK\n")
And this is the log:
> options(error=quote({dump.frames("t.dump", to.file=TRUE); q()}))
>
>
> try({ stop("error in try") })
Error in try({ : error in try
So my question is why the error handler was invoked within try() and what do
I need to do to avoid this?
Thank you,
Vadim
--------------------------------------------------
DISCLAIMER \ This e-mail, and any attachments thereto, is intend ... [[dropped]]
More information about the R-help
mailing list