-
Notifications
You must be signed in to change notification settings - Fork 139
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
Implement source
for error types
#410
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.
ACK 013922c
I did not check that this exhaustively implements Error
everywhere that it can/should be.
I can't guarantee I didn't miss any, I used |
Face palm, I did this same work in
My OCD cannot handle that so I'll fix them both tomorrow, sending this to draft. Please comment if you have an opinion on these otherwise I'll arbitrarily pick and do them all the same. |
No opinion :). |
Put the `SigType` enum below where it is first used instead of in the middle of the error types/impls.
The `description` method is deprecated since Rust 1.33.0, now we are on MSRV of 1.41.1 we can remove it in favour of `Display`.
Audit the whole codebase and re-order code around error handling so that it is all in a uniform layout in the file, specifically 1. Error declaration 2. impl Display ... 3. impl error::Error ... 4. All the From impls Refactor only, no logic changes. All changes are just moving blocks of code around.
013922c
to
3e5ef23
Compare
Now that we have an MSRV of 1.41.1 we can implement `std::Error` by way of the `cause` method. Audit the whole codebase and implement `cause` for all error types, matching explicitly on enum variants so we don't forget to update the impls if/when the error enums get modified.
3e5ef23
to
5935d86
Compare
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.
ACK 5935d86
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.
ACK 5935d86. Checked that all changes correctly pass through the source. Did not check whether there are more Error types that are not covered.
Now we have MSRV of 1.41.1 we can implement
source
for improved error handling.Patches 1-3 are preparatory cleanup, patch 4 adds all the
source
impls.Resolves: #273