Closed gothub closed 7 years ago
To resolve this, if warn
is set to < 2, record()
will source the user script with suppressWarnings()
so that the script can complete even if a warning is encountered. If warn
>=2, then the script is
sourced without suppressWarnings()
and warnings (treated as errors now) will cause the script.
The result is that running an R script directly with source()
and with record()
has the
same error handling behaviour, whatever the user has set option(warn)
to be.
Fixed in commit b7a5e78936588a086a2dfaec30943ba3255ab81f
R option
warn
< 2 will allow a sourced script to run completely even if a warning is encountered in the script. Whenrecord()
sources a user script, it does so in atryCatch
block (as required specifically of recordr by CRAN), which causes control to return from therecord()
source script immediately when any warning is encountered.