Skip to content
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

Entrace base errors? #230

Closed
lionel- opened this issue Jan 3, 2019 · 7 comments · Fixed by #449
Closed

Entrace base errors? #230

lionel- opened this issue Jan 3, 2019 · 7 comments · Fixed by #449
Labels
feature a feature request or enhancement

Comments

@lionel-
Copy link
Member

lionel- commented Jan 3, 2019

This is a follow-up to #229 and how dev rlang always shows a backtrace on error in non-interactive sessions. It might be helpful and more consistent to entrace base errors with rlang::entrace(). Unfortunately, simply setting options(error = rlang::entrace) doesn't work because rmarkdown::render() captures the errors before entrace() has a chance to be called.

Would it be worth it to find a solution to that problem? The easiest way might be to add an option to entrace errors in rmarkdown itself.

@lionel-
Copy link
Member Author

lionel- commented Jan 5, 2019

Proof of concept at fix-top-trace...add-base-entrace:

remotes::install_github("tidyverse/reprex@add-base-entrace")

When prompted, upgrade knitr and evaluate.

@hadley
Copy link
Member

hadley commented Jan 8, 2019

We should also provide some optional way to activate this for warnings too.

@lionel-
Copy link
Member Author

lionel- commented Jan 8, 2019

options(warn = 2) should work. But won't that create misleading reprexes if we enable it by default?

@lionel-
Copy link
Member Author

lionel- commented Jan 8, 2019

Or should we capture all warnings, with an accompanying trace?

@lionel-
Copy link
Member Author

lionel- commented Jan 8, 2019

r-lib/rlang#714

@jennybc jennybc added the feature a feature request or enhancement label May 17, 2019
@jennybc
Copy link
Member

jennybc commented Aug 20, 2020

@lionel- Has the world changed since we last discussed this? What's the best way to support entrancing base errors?

@lionel-
Copy link
Member Author

lionel- commented Aug 21, 2020

Adding entrace as a calling handler. That's also the correct way to entrace rlang errors. Cf the weird dplyr example I've just posted in the other thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants