Refine Display
implementation for FlightError
#5438
Labels
arrow
Changes to the arrow crate
arrow-flight
Changes to the arrow-flight crate
enhancement
Any new improvement worthy of a entry in the changelog
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
There's a
TODO
for a betterstd::fmt::Display
implementation onFlightError
. Currently it forwards tostd::fmt::Debug
, which does not appear to be a good practice as errors should describe themselves with friendly messages provided byDisplay
.arrow-rs/arrow-flight/src/error.rs
Lines 50 to 55 in ef5c45c
Describe the solution you'd like
Match the variants of the error and specify different prompts like what we did for
ArrowError
.arrow-rs/arrow-schema/src/error.rs
Lines 79 to 87 in ef5c45c
Describe alternatives you've considered
Derive the implementation with
thiserror
. The code can be more concise with the cost of introducing a new build-time dependency.Additional context
A better practice to implement
Display
for errors is NOT to include the error source. AWS SDK has adopted this as described in awslabs/aws-sdk-rust#657. However, this could be considered as a breaking change as many developers have not realize that one should leverage something likestd::error::Report
to get the error sources printed.The text was updated successfully, but these errors were encountered: