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

Provide function to rethrow conditions while keeping the original condition and call stack #30

Open
aryoda opened this issue Jun 9, 2018 · 1 comment

Comments

@aryoda
Copy link
Owner

aryoda commented Jun 9, 2018

Use cases:

  • Wrap technical errors to present end-user-friendly errors (e. g. in shiny apps or other UIs)

Mainly important for errors and warnings...

Possible signature:

rethrow <- function(condition, message = condition.msg, custom.class, ...)

The rethrown condition inherits the classes of the condition argument
but belongs to an additional rethrow* class to make it easy to recognize
as rethrown condition and to extract the additional information like
call.stack, original (wrapped) condition, custom error number...

See also:

@aryoda aryoda changed the title Provide functions to rethrow conditions while keeping the original condition and call stack Provide function to rethrow conditions while keeping the original condition and call stack Jun 9, 2018
@aryoda
Copy link
Owner Author

aryoda commented Jul 31, 2022

I think it is impossible to implement this in a lean way currently for error conditions since they cannot be silenced and always bubble-up to all handlers for that.

"Rethrow" would require to silence the error and throw another condition instead.

I tend to reject these feature request (even I love the idea behind it quite well - at least for application programming with user interfaces)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant