-
Notifications
You must be signed in to change notification settings - Fork 13
feat: more expressive errors #44
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you! I also appreciate the refactoring around deserializing the responses, that is much clearer too.
src/common/errors.rs
Outdated
| }, | ||
| } | ||
|
|
||
| impl PartialEq for CreateKeypairError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all these PartialEq only compare variants and not the underlying source fields, it feels like that should be documented for types, and perhaps Eq not be implemented.
|
|
||
| /// Serialization error | ||
| #[derive(Error, Debug)] | ||
| pub enum SerializationError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you want to impl PartialEq here for SerializationError?
|
@jcjones It turns out that the changes from #45 make #42 somewhat more complicated. Since we can now have several public keys for which we verify a signature, we expect signature verification to fail for all but one key. Therefore it's not entirely clear what we should return. Some options:
|
|
Thorny. I agree with not changing the Perhaps this is a thing for debug logging instead? Or expanding the doc comment on |
|
I think both options you propose are valid. In the case of debug logging, it would probably be good to have more logging than just for that case. Do you want to file a PR for the solution you prefer? |
|
I'll put together a PR. Thanks! |
|
I've opened #48 to replace this PR. |
No description provided.