Closed mdneuzerling closed 3 years ago
Is this the correct way to get the stacktrace of an error in a tryCatch? Does it leave behind a current_error variable that needs to be cleaned up?
tryCatch
current_error
post_lambda_error <- function(e, endpoint) { utils::dump.frames("current_error") current_traceback <- names(current_error) error_list <- list( errorMessage = e$message, errorType = class(e)[[1]], stackTrace = current_traceback ) error_json <- jsonlite::toJSON(error_list, auto_unbox = TRUE) httr::POST( url = endpoint, body = error_json, encode = "raw", httr::content_type("application/vnd.aws.lambda.error+json") ) }
Is this the correct way to get the stacktrace of an error in a
tryCatch
? Does it leave behind acurrent_error
variable that needs to be cleaned up?