alamb commented on code in PR #3567:
URL: https://github.com/apache/arrow-rs/pull/3567#discussion_r1081612923
##########
arrow-flight/src/error.rs:
##########
@@ -52,7 +54,15 @@ impl std::fmt::Display for FlightError {
}
}
-impl std::error::Error for FlightError {}
+impl Error for FlightError {
+ fn source(&self) -> Option<&(dyn Error + 'static)> {
+ if let Self::ExternalError(e) = self {
Review Comment:
My reading of
https://doc.rust-lang.org/std/error/trait.Error.html#method.source
> The lower-level source of this error, if any.
Suggests that the iteration all the way down a chain of errors should be
done outside the `Error::source`. For example I believe this iteration is what
https://docs.rs/snafu/0.7.4/snafu/trait.ErrorCompat.html#method.iter_chain is
for.
So in other words, I don't think the source() method should have the
traversal (even if ArrowError is being silly and boxing itself)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]