Implement Error::Source
for ArrowError and FlightError
#3566
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.
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 presentI 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
However, ArrowError does not implement
source
yetOf course, all the errors in the chain need to implement this
Describe the solution you'd like
For ArrowError / FlightError that wrap other errors, implement
Error::source()
Describe alternatives you've considered
See https://github.com/apache/arrow-datafusion/blob/dde23efed94704044822bcefe49c0af7f9260088/datafusion/common/src/error.rs#L361-L439 for what we need to do now in datafusion 🤮
cc @crepererum
Additional context
The text was updated successfully, but these errors were encountered: