-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improve Errno error handling #8305
Comments
Another solution if to have something like |
So this might be just a duplicate of #1124 |
Actually is #5003 "Change Errno into a hierarchy of OSError subclasses" |
Thanks @oprypin for referencing your PR. I remembered there had been prior discussions, but couldn't find that specific one. Currently, |
In my opinion, My vision for exceptions at There might be technical problems that need to be overcome to achieve a better API but they can be solved like any other. |
Dunno if related but here's an example where IO::Error was caught but it allowed Errno to still propagate up through (accidentally): #7136 (comment) FWIW :) |
Closed with #8885 |
Current issues with having
Errno
constants are:Errno
exceptions can't be rescued specifically – that's either all or none.Errno#errno
is the only way to know the actual error type.The solution would be to use classes for errno errors to be able to differentiate them, in order to prevent the user to deal with integers.
The text was updated successfully, but these errors were encountered: