rlang_backtrace_on_error {rlang}R Documentation

Display backtrace on error

Description

Errors thrown with abort() automatically save a backtrace that can be inspected by calling last_error(). Optionally, you can also display the backtrace alongside the error message by setting the option rlang_backtrace_on_error to one of the following values:

Promote base errors to rlang errors

Call options(error = rlang::entrace) to instrument base errors with rlang features. This handler does two things:

Examples

# Display a simplified backtrace on error for both base and rlang
# errors:

# options(
#   rlang_backtrace_on_error = "branch",
#   error = rlang::entrace
# )
# stop("foo")

[Package rlang version 0.4.5 Index]