BugenZhao opened a new issue, #5438:
URL: https://github.com/apache/arrow-rs/issues/5438

   **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`.
   
   
https://github.com/apache/arrow-rs/blob/ef5c45cf4186a8124da5a1603ebdbc09ef9928fc/arrow-flight/src/error.rs#L50-L55
   
   **Describe the solution you'd like**
   
   Match the variants of the error and specify different prompts like what we 
did for `ArrowError`.
   
   
https://github.com/apache/arrow-rs/blob/ef5c45cf4186a8124da5a1603ebdbc09ef9928fc/arrow-schema/src/error.rs#L79-L87
   
   **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 
https://github.com/awslabs/aws-sdk-rust/issues/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`](https://doc.rust-lang.org/stable/std/error/struct.Report.html)
 to get the error sources printed.


-- 
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]

Reply via email to