-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: Minor improvements to error visibility #230
Conversation
f4e50d6
to
76a22c7
Compare
src/connection.rs
Outdated
// errors should always contain at least 1 element here. | ||
let errors_string = errors | ||
.into_iter() | ||
.map(|e| e.to_string()) |
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.
I suggest you create a helper type here to delay the error formatting until it is actually needed:
struct MultiError(Vec<Box<dyn std::error::Error + Send + Sync>);
impl std::error::Error for MultiError {...}
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.
Sure, that's probably better. Maybe it would even be more useful with
struct MultiError<T: std::error::Error + Send + Sync + 'static>(Vec<T>)
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.
Though since we're sticking it in a Box<dyn ...>
anyway I guess it doesn't make much of a difference in this case.
76a22c7
to
9b70a52
Compare
tests need a fix and the commit message shall follow Conventional Commits (just prefix it with |
9b70a52
to
0fa23f0
Compare
This commit also removes a few unhelpful comments that are no longer correct.
0fa23f0
to
d121e81
Compare
I have three separate commits, as they are technically three separate changes, but I'll squash them if you prefer. Also, I think technically they are features, since they are visible to users. |
d121e81
to
badfe9d
Compare
Thank you and sorry for the review delay. |
This PR makes a few small changes:
BackoffError
to also include thesource
error.connection::Error
asConnectionError
. Currently it is not visible at all, sinceconnection
is a private module.Nothing should be breaking or particularly intrusive.