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

More robust and precise error handling. #14

Merged
merged 1 commit into from Jan 8, 2015
Merged

More robust and precise error handling. #14

merged 1 commit into from Jan 8, 2015

Conversation

@bitonic
Copy link
Collaborator

bitonic commented Jan 7, 2015

When decoding, decoding errors are now isolated from IoErrors.

Decoding is also more strict in various circumstances, see new test.

@bitonic
Copy link
Collaborator Author

bitonic commented Jan 7, 2015

(It currently doesn't build because rust-lang-deprecated/rustc-serialize#19 isn't merged)

@TyOverby
Copy link
Collaborator

TyOverby commented Jan 8, 2015

I think this is the way to go, but Ok(try!(foo)) could be replaced with foo.map_err(DecodingError::IoError) and I think it reads clearer. If you wanted to write a to_io function so you could write fo.map_err(to_io), that would probably win any brevity contest.

Also, could you rebase? Github isn't letting me merge.

When decoding, decoding errors are now isolated from `IoError`s.
@bitonic bitonic force-pushed the better-errors branch from b833a56 to fd81c7d Jan 8, 2015
@bitonic
Copy link
Collaborator Author

bitonic commented Jan 8, 2015

Rebased. I see nothing wrong with using try! that way -- that FromError trait seems to serve that purpose well. If you want to change the style using some other function, feel free to do it and merge.

@TyOverby
Copy link
Collaborator

TyOverby commented Jan 8, 2015

Ok, I'll do it post-merge.

TyOverby added a commit that referenced this pull request Jan 8, 2015
More robust and precise error handling.
@TyOverby TyOverby merged commit 810d5a0 into master Jan 8, 2015
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@TyOverby TyOverby deleted the better-errors branch Jan 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

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