-
Notifications
You must be signed in to change notification settings - Fork 117
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
Why TypeError is not subclass of UnpackError? #83
Comments
That "was" because of a plan to implement data type conversion module like msgpack-java's Template or jackson-dataformat-msgpack. MessageTypeException defined there can be thrown from "data type conversion module" which is not unpacker. |
frsyuki
added a commit
that referenced
this issue
Aug 3, 2015
This change adds MessagePack::UnexpectedTypeError which extends UnpackError. Unpacker raises it instead of TypeError. This doesn't take alternative idea which changes TypeError to extends UnpackError for 2 reasons: * For backward compatibility with existent code which expects that rescuing TypeError doesn't rescue UnpackError. * Name of "TypeError" is confusing with Ruby's standard "::TypeError". For backward compatibility, TypeError is changed to Module and UnexpectedTypeError includes it.
frsyuki
added a commit
that referenced
this issue
Aug 5, 2015
This change adds MessagePack::UnexpectedTypeError which extends UnpackError. Unpacker raises it instead of TypeError. This doesn't take alternative idea which changes TypeError to extends UnpackError for 2 reasons: * For backward compatibility with existent code which expects that rescuing TypeError doesn't rescue UnpackError. * Name of "TypeError" is confusing with Ruby's standard "::TypeError". For backward compatibility, TypeError is changed to Module and UnexpectedTypeError includes it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is strange, that MessagePack::TypeError is a separate species. Why it is not sublclass of UnpackError?
The text was updated successfully, but these errors were encountered: