[R] Perform task on error

brt brt381 at mail.usask.ca
Wed Jul 24 22:06:46 CEST 2013


I have a web service that uses an R script to perform the analysis.  At the
end of the R script, I use the system function to call an external (perl)
script that sends the user an e-mail telling them that their analysis has
finished running, and where they can download the results.  However, if the
R script crashes (say...

Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, 
: 
  line 5 did not have 42 elements
Calls: as.matrix -> read.table -> scan
Execution halted

), I want the R script to call an external script that will e-mail the user
telling them that an error has occurred. I do not want to use try-catch
blocks because I want this to happen no matter what/where the error, and
because the script is large and it would be unwieldy to try to catch
specific things. Is this possible, and if so, how?

Thank you very much in advance for any help!



--
View this message in context: http://r.789695.n4.nabble.com/Perform-task-on-error-tp4672258.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list