I have a script that I run from the commandline, like
Rscript example.R
and I'd like to have it tell me some debugging information when it exits. If I don't do anything special, if it hits an error, it exits, right there, and I see the error message. So, I added
options(error=traceback)
and then it gave me not only the error message but the stack at the time of the error, very useful. Great.
But now the script continues on through to the end, tossing up a lot more errors. Why does setting the error change Rscript's behaviour on encountering an error? How do I get it to just exit after the first error, as before?