Description Usage Arguments Value Author(s) See Also Examples
Functional that creates a dump on error in function FUN
1 | dumpOnError(FUN, dumpFileBaseName = "last.dump")
|
FUN |
function to be wrapped |
dumpFileBaseName |
baseName of the rda file to dump session to |
result of call to FUN, or error thrown by FUN with side effect of a dump created
Thomas Wutzler
1 2 3 4 5 6 7 8 9 10 11 | throwsError <- function(x){ stop("error in function throwsError.") }
f2 <- function(...){throwsError(...)}
dumpedFun <- dumpOnError(f2)
if( FALSE ){ # do not run non-interactive
result <- dumpedFun(1) # throws an error
# replace last.dump with value supplied to dumpFileBaseName
load("last.dump.rda")
debugger(last.dump)
# select item #3 FUN(...), i.e. f2, or #4 call to throwsError from f2
# inspect value of list(...) in f2 or argument x supplied to throwsError
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.