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

[new-feature] Exception re-raising #6

Open
0exp opened this issue Feb 27, 2023 · 0 comments
Open

[new-feature] Exception re-raising #6

0exp opened this issue Feb 27, 2023 · 0 comments
Labels

Comments

@0exp
Copy link
Member

0exp commented Feb 27, 2023

rescue => error
  re_raise_as(SomeExceptionClass, error) # and custom message (may be)
end
def re_raise_as(exception_klass, error) # and custom message (may be)
   exception = exception_klass.new(error.message)
   exception.set_backtrace(error.backtrace)
   raise(exception)
end
@0exp 0exp added the feature label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant