Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
There's a TODO
for a better std::fmt::Display
implementation on FlightError
. Currently it forwards to std::fmt::Debug
, which does not appear to be a good practice as errors should describe themselves with friendly messages provided by Display
.
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 like std::error::Report
to get the error sources printed.