> options(error = rlang::entrace)
> x <- "/tmp/no/such/file"
> local({
+ readLines(x)
+ })
Error in file(con, "r") :
(converted from warning) cannot open file '/tmp/no/such/file': No such file or directory
Run `rlang::last_trace()` to see where the error occurred.
> rlang::last_trace()
<error/rlang_error>
Error:
! No such file or directory
---
Backtrace:
▆
1. ├─base::local(...)
2. │ └─base::eval.parent(substitute(eval(quote(expr), envir)))
3. │ └─base::eval(expr, p)
4. │ └─base::eval(expr, p)
5. └─base::eval(...)
6. └─base::eval(...)
7. └─base::readLines(x)
8. └─base::file(con, "r")
Would it be possible for rlang to include "scalar" values for parameters in these error traces, so that we could get something like:
Consider something like:
Would it be possible for
rlang
to include "scalar" values for parameters in these error traces, so that we could get something like:(Not sure if there's a more appropriate syntax for values presented in this way)
Motivation; it would help in diagnosing backtraces like this: