carlsverre opened a new issue, #579:
URL: https://github.com/apache/arrow-rs-object-store/issues/579
**Describe the bug**
If an `HttpError` occurs in a retry context, the error is mapped into a
`retry::RequestError`, which is not public to this crate. However, when you try
to retrieve the underlying `HttpError` via recursively calling `source`, you
instead receive the lower-level `reqwest::Error`. This makes handling HttpError
types consistently difficult for consumers who may not want to know about
`reqwest`.
**To Reproduce**
Receive an HttpError in a retry context. Attempt to retrieve the underlying
HttpError using something like:
```rust
let mut err: &dyn Error = &e;
let mut found = false;
while let Some(source) = err.source() {
err = source;
if let Some(err) = err.downcast_ref::<HttpError>() {
found = true;
assert_eq!(err.kind(), HttpErrorKind::Request);
}
}
assert!(found, "HttpError not found in source chain");
```
**Expected behavior**
I get an HttpError
**Additional context**
<!--
Add any other context about the problem here.
-->
--
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]