-
Notifications
You must be signed in to change notification settings - Fork 238
Excepetions hierarchy #170
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
Conversation
…ckBaseException. cython and fallback throws same exceptions
I don't like it. Why base exception is required? There are no BaseJsonException in json module. |
|
I think it is easier for a user when there is a base exception if he wants to catch all exception that are related to the specific module. I think maybe changing it to MsgpackException from MsgpackBaseException will be better. |
He should catch just In case of requests module, there are many completely different reasons to fail to request: lookup, connect, HTTP error, timeout, etc... |
|
All difference between msgpack module and json module should be coming from difference between msgpack and json. |
|
I thought the root exception will be something nice to add (I don't see any down side) but I can see why msgpack is more like json and less like requests. |
| x = -(2 ** 63) | ||
| assert unpackb(packb(x)) == x | ||
| with pytest.raises((OverflowError, ValueError)): | ||
| with pytest.raises(expected_exception): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this parameterize is too much.
Test only with most concrete exception type.
More public names is significant downside. |
I noticed that when I use the message fallback instead of the cython i get different Exception. On my way to fixing this I tried to improve the exceptions in general.
The branch does the following improvements: