Anyone knows a way to re-throw a caught interrupt condition, so that
it behaves just like the original one? I.e. no error message is
printed, but the execution is stopped of course. With just calling
stop in the error handler, it prints the error message, or, if there
is no error message (like in the original interrupt condition),
another error happens.

tryCatch(Sys.sleep(100), interrupt = function(e) {  e$message <-
"interrupted"; stop(e) } )
<press CTRL + C / ESC here>
#> Error: interrupted

tryCatch(Sys.sleep(100), interrupt = function(e) stop(e))
<press CTRL + C / ESC here>
#> Error in stop(e) : bad error message

Thanks,
Gabor

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to