Examples for 'rlang::local_error_call'


Set local error call in an execution environment

Aliases: local_error_call

Keywords:

### ** Examples

# Set a context for error messages
function() {
  local_error_call(quote(foo()))
  local_error_call(sys.call())
}
<srcref: file "" chars 6:1 to 9:1>
<environment: 0x55ccfe071ca8>
# Disable the context
function() {
  local_error_call(NULL)
}
<srcref: file "" chars 12:1 to 14:1>
<environment: 0x55ccfe071ca8>
# Use the caller's context
function() {
  local_error_call(caller_env())
}
<srcref: file "" chars 17:1 to 19:1>
<environment: 0x55ccfe071ca8>

[Package rlang version 1.1.4 Index]