-
Notifications
You must be signed in to change notification settings - Fork 35
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
Teach evaluate about condition handlers #98
Comments
I experimented with this in: |
Would also be cool if evaluate could automatically cross-register global error handlers. |
This was implemented in #105
For expected errors you mean, because our try-catch prevents the global handlers from running? hmm... Interesting idea but automatically copying handlers on top of an existing R stack has the potential for unexpected behaviour. We'd need to check whether this has unintended effects with Ark for instance (I think it does). Alternatively we could require the handler to implement some interface that declares it's okay to copy it in nested "repl" contexts. |
Ok great! Yeah I also realised copying automatically is likely to be fraught. Might instead be better for evaluate to expose its own system for registering handlers. Anyway I’ll keep thinking about it as I work on evaluate. |
@lionel- and I have talked about this (tidyverse/reprex#320 (comment)) but I want to open a specific issue.
Until this happens,
rlang::last_error()
andrlang::last_trace()
don't work, in general, in knitr and, therefore, in reprex. We can still dooptions("rlang:::force_unhandled_error" = TRUE)
on a case-by-case basis, but @lionel- feels it does more harm than good if I were to make that global or default reprex behaviour.The text was updated successfully, but these errors were encountered: