I just found this internal R source code:
if (inError) { if(inError == 3) { REprintf(_("Error during wrapup: ")); Rvsnprintf(errbuf, sizeof(errbuf), format, ap); REprintf("%s\n", errbuf); }
stop() causes the error handler to execute. If the stop() call is encountered inside an error handler, R displays an Error during wrapup: message and prevents you from infinite recursion that occurred otherwise.
Do not call stop() from within options$error .
Use q(save="no", status=1, runLast=FALSE) instead to do what the default error handler does for non-interactive use. For more information about error handling, see ?options for the options$error and ?stop values.
source share