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

Polish all error messages #98

Closed
dtolnay opened this issue Jan 31, 2017 · 3 comments
Closed

Polish all error messages #98

dtolnay opened this issue Jan 31, 2017 · 3 comments
Milestone

Comments

@dtolnay
Copy link
Collaborator

@dtolnay dtolnay commented Jan 31, 2017

The current error messages have an unfriendly Display representation. For example SerializeError in 9e47b71:

impl fmt::Display for SerializeError {
    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        match *self {
            SerializeError::IoError(ref err) => write!(f, "IoError: {}", err),
            SerializeError::Custom(ref s) => write!(f, "Custom Error {}", s),
            SerializeError::InfiniteSequence => write!(f, "InfiniteSequence"),
            SerializeError::SizeLimit => write!(f, "SizeLimit"),
        }
    }
}

Let's audit all the error messages in this crate and make sure everything has a self-explanatory message that a human can read and understand what went wrong.

@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented Jan 31, 2017

I think a neat feature of the errors (once merged) would be tracking if they came from encoding or decoding.

Example:

While decoding, bincode hit an IoError from the underlying reader: $IOERRORTEXT
vs
While encoding, bincode hit an IoError from the underlying writer: $IOERRORTEXT

@TyOverby TyOverby modified the milestone: 1.0 Feb 23, 2017
@dtolnay
Copy link
Collaborator Author

@dtolnay dtolnay commented Apr 28, 2017

I filed individual issues for the error message problems I noticed.

@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented Oct 14, 2017

Closed all of these (I think)

@TyOverby TyOverby closed this Oct 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.