alamb opened a new pull request, #3567:
URL: https://github.com/apache/arrow-rs/pull/3567

   # Which issue does this PR close?
   
   Close https://github.com/apache/arrow-rs/issues/3566
   
   # Rationale for this change
    
   In IOx (and in DataFusion) we often want to know what the root cause of an 
error is (e.g was it a bug or was it a resources exhausted). ArrowError can 
wrap other errors with `Arrow::External` (and DataFusion has something similar) 
but there is no easy way to get at the source of the error to walk the chain 
without knowing all the possible types that may be present
   
   I believe this is what 
https://doc.rust-lang.org/std/error/trait.Error.html#method.source is for
   
   I would like to be able to write something like this to walk the chain
   ```rust
   
           let mut root_error: &dyn Error = &e3;
           loop {
               match root_error.source() {
                   // walk the next level
                   Some(source) => root_error = source,
                   // at root (as much as we know)
                   None => break,
               }
           }
   
   ```
   However, ArrowError does not implement `source` yet
   
   Of course, all the errors in the chain need to implement this
   
   # What changes are included in this PR?
   1. Implement `std::error::Error::source` for `ArrowError` and `FlightError`
   2. tests for same
   
   # Are there any user-facing changes?
   
   source() sometimes now returns something useful
   


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