-
Notifications
You must be signed in to change notification settings - Fork 236
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
Would using thiserror crate be acceptable for the error handling? #638
Comments
If you want to use it just for defining error messages via derive macro then I think this is unnecessary. My points are:
If you like also rework our errors to make them more ergonomic, then I'm not against. Actually, we should do that, some of our errors are cryptic. I also would like to have backtraces in our errors, but I'm unsure should we do something special to give them or we can get them automatically. Rust books is not clear about that. The other thing that we lack in our errors is a position information (there is a dedicated issue for this -- #625). I would like to learn approaches used in other serde format libraries. |
This all sounds reasonable. I do think that thiserror is a good path
forward. I think it might help with making the errors more ergonomic, which
is part of my intent.
|
The thiserror crate takes care of a bunch of details of implementing errors for a library in rust. This will simplify the code around our errors by making it follow conventions that are widely used in the rust community. It also is much shorter in terms of lines of code. Closes tafia#638
I would like to refactor the errors crate to use the thiserror crate. The patterns implemented in the module are very similar to the crate. The crate is widely used in rust libs. I think it would probably raise the quality of the code a bit to use the crate. Would this be an interesting change?
The text was updated successfully, but these errors were encountered: