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

Handle the case where a Serialize fails without calling the Serializer #100

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

KodrAus
Copy link
Contributor

@KodrAus KodrAus commented Dec 13, 2023

Hey! 👋

Upgrading to 0.4 I found if a Serialize itself fails without ever calling the given Serializer then we'll hit an unreachable!(). I've got a repro as a test case in this PR. The solution I've got here is to return a generic message suggesting the value itself failed. That may not be ideal since it loses the original error, but is still better than panicking.

Is there any better way this could be handled?

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@dtolnay dtolnay merged commit 7ddf6aa into dtolnay:master Dec 14, 2023
10 checks passed
@dtolnay
Copy link
Owner

dtolnay commented Dec 14, 2023

Is there any better way this could be handled?

I opened #101 to preserve the message.

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.

2 participants