-
Notifications
You must be signed in to change notification settings - Fork 270
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
Improvements to error handling #633
Comments
concept ACK. We will probably wind up with multiple layers of nested errors and we should make sure that we have |
I like the idea, any reason you posted this in |
Yes, we will add impls from all individual types to top level error. Note that users can call
No special reason. I wanted to try a PR in this repo first because there is small code surface and APIs can be easily separated. |
Just read this, I already fixed up rust-bitcoin/rust-bitcoin#1950 to try out your idea. |
FYI this is exactly what I wanted for a while, so I'm happy with this. |
Here is one strategy that I think we should do to improve the ergonomics of errors. Broadly speaking, there are two ways users can interact with secp API.
Right now, our API is not the most convenient for users (2). For example,
Signature::from_der
returns only one error variant but the user is forced to match against all variants.Proposal
Have each API return a separate error type that does not have any variants that are unreachable. Provide a top level common error type to unify all error types for users who just want to bubble up errors.
The text was updated successfully, but these errors were encountered: