-
Notifications
You must be signed in to change notification settings - Fork 254
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
Make sure to also rescue non-standard error #269
Conversation
we'll also need a test that explains the usecase / would not work with the old code |
Address the code review comments Co-Authored-By: Michael Grosser <michael@grosser.it>
Sure, will add a test case. BTW, I noticed that Update: |
1.19.0 ... let's see if this comes back to bite us :D |
Haha, let's see. 😄 |
Neat change! I wonder if this list should also have module AllExceptionsExceptOnesWeMustNotRescue
# These exceptions are dangerous to rescue as rescuing them
# would interfere with things we should not interfere with.
AVOID_RESCUING = [NoMemoryError, SignalException, Interrupt, SystemExit]
def self.===(exception)
AVOID_RESCUING.none? { |ar| ar === exception }
end
end Our usage of |
awesome, I copied that in 1.19.1 |
A potential way to solve #268
I tried to raise the SystemExit again as we have this test case:
If I just rescue all the exceptions, this test will fail since no DeadWorker will be raised when the worker exits.
I'm also thinking about allowing users to specify the non-standard errors that they wish to rescue. By doing this, we may not need to handle all different edge cases and just let the users choose what to rescue.