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

Add custom SerdeJsonError throughout crates #165

Open
kirahsapong opened this issue May 6, 2024 · 1 comment
Open

Add custom SerdeJsonError throughout crates #165

kirahsapong opened this issue May 6, 2024 · 1 comment

Comments

@kirahsapong
Copy link
Contributor

kirahsapong commented May 6, 2024

Check crates for redundant usage of mapping serde json errors and replace with custom SerdeJsonError enums

Example in #163 - https://github.com/TBD54566975/web5-rs/pull/162/files#diff-72c9a6b1202bfaaf136121542f68f9cb3af89464ab3fe04e52d29063c986bd9eR31

@KendallWeihe
Copy link
Contributor

The more general case would be to try and remove any case wherein we have to make a call to .map_err() (not just with the serde_json error, but of any error type which isn't already automatically mapped); instead, it would be ideal for all error mappings to occur automatically via the impl of the From trait (this way .map_err() can just be replaced with the ? operator)

This is the exact commit hash where we did this, for both the serde_json error case and the base64 error case 6237daf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants