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

Better Details for BSON Deserialization Errors #435

Open
clarkmcc opened this issue Oct 11, 2023 · 5 comments
Open

Better Details for BSON Deserialization Errors #435

clarkmcc opened this issue Oct 11, 2023 · 5 comments
Assignees
Labels
tracked-in-jira Ticket filed in Mongo's Jira system

Comments

@clarkmcc
Copy link

When I get a BSON deserialization error, it looks something like this

invalid type: unit value, expected a sequence

Is it possible to have the error contain more helpful information, like the path or something like that? I've been stomping out little deserialization issues for the last several months, and it's tricky to figure out exactly what set it off.

@abr-egn
Copy link
Contributor

abr-egn commented Oct 17, 2023

We recognize that the current error messages aren't great; unfortunately, the way serde is set up makes it tricky to include path or other source location. This is definitely on our roadmap, though - you can follow https://jira.mongodb.org/browse/RUST-1246 for updates.

@abr-egn abr-egn added tracked-in-jira Ticket filed in Mongo's Jira system and removed triage labels Oct 17, 2023
@clarkmcc
Copy link
Author

Thanks! Is it possible for me to somehow utilize dtolnay/path-to-error or would this need to be incorporated in this crate?

@jaredtmartin
Copy link

jaredtmartin commented Oct 24, 2023

I'm in the same situation. I like your idea @clarkmcc of using dtolnay/path-to-error. Have you figured out how to implement it? If not have you found any other solution/workaround?

@bastibense
Copy link

Yes, please. The current errors are not very helpful at all and I had to trial-and-error myself through this.
Feels bad, man.

@clarkmcc
Copy link
Author

@jaredtmartin unfortunately I don't have a solution for this but yes, it's a real pain to deal with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracked-in-jira Ticket filed in Mongo's Jira system
Projects
None yet
Development

No branches or pull requests

4 participants