-
-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Display error tracebacks when vignettes fail #2390
base: master
Are you sure you want to change the base?
Conversation
res[i] = xfun:::handle_error( | ||
withCallingHandlers( | ||
if (tangle) process_tangle(group) else process_group(group), | ||
error = function(e) { | ||
if (progress && is.function(pb$interrupt)) pb$interrupt() | ||
if (xfun::pkg_available('rlang', '1.0.0')) rlang::entrace(e) | ||
|
||
if (xfun::pkg_available('rlang', '1.0.0')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For vignettes, this implies that your package needs to depend on rlang. I think that's ok, but should be documented somewhere.
# return a string to point out the current location in the doc | ||
get_loc = function(label = '') { | ||
paste0(current_lines(), label, sprintf(' (%s)', knit_concord$get('infile'))) | ||
paste0(knit_concord$get('infile'), ":", current_lines(), label) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses a more standard format for file + line numbers that VS Code/Positron will autolink. I think it's still worthwhile to use cli here, so I'll explore adding that in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And cli hyperlinks don't work in R CMD check anyway, because if it did, it would open in the file in the check directory, not the current project.
Recording some work so that I can come back to it later.