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

Improve deserialization error message #505

Merged
merged 2 commits into from
Dec 22, 2020
Merged

Improve deserialization error message #505

merged 2 commits into from
Dec 22, 2020

Conversation

jplatte
Copy link
Contributor

@jplatte jplatte commented Dec 21, 2020

I'm submitting a refactor

Description

Improves the deserialization error message by including that a UUID was attempted to be parsed.

Before: invalid length: expected one of [36, 32], found 11
After: UUID parsing failed: invalid length: expected one of [36, 32], found 11

Motivation

It was not easy to tell from the previous error message what went wrong when trying to deserialize a larger object containing a UUID.

Tests

I added a unit test.

Related Issue(s)

Closes #499

The entire module is already feature-gated in `lib.rs`.
It now states that it was trying to deserialize a UUID, which was
unclear before.
Copy link
Member

@kinggoesgaming kinggoesgaming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

@kinggoesgaming
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 22, 2020

Build succeeded:

@bors bors bot merged commit 34a4f1c into uuid-rs:master Dec 22, 2020
@jplatte jplatte deleted the de_error_msg branch December 22, 2020 22:11
@KodrAus KodrAus mentioned this pull request Jan 8, 2021
bors bot added a commit that referenced this pull request Jan 11, 2021
508: prepare for 0.8.2 release r=KodrAus a=KodrAus

Includes:

- #504 
- #505 
- #506 

Co-authored-by: Ashley Mannix <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message when trying to parse a random string as a UUID is not helpful
2 participants