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

Deserializable should have an associated type error #269

Open
hackaugusto opened this issue Apr 4, 2024 · 0 comments
Open

Deserializable should have an associated type error #269

hackaugusto opened this issue Apr 4, 2024 · 0 comments

Comments

@hackaugusto
Copy link
Contributor

Currenlty, the Deserializable trait forces the use of DeserializationError. The only viable way of using it downstream is to use UnknownError(String) or InvalidValue(String), which forces the user site to convert the error to a string prematurely. This often means there is less context in the errors after deserialization, specially when the underlying structure failed validation after deserialization.

To improve the error reporting and error handling, the trait should be modified to have an associated type error.

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

No branches or pull requests

1 participant