thinkharderdev opened a new issue, #5345:
URL: https://github.com/apache/arrow-rs/issues/5345
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
<!--
A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]
(This section helps Arrow developers understand the context and *why* for
this feature, in addition to the *what*)
-->
When we get a client error (HTTP status code 4xx), the status code is not
always accessible from client code.
```
return Err(match status.is_client_error() {
true => match r.text().await {
Ok(body) => {
Error::Client {
body: Some(body).filter(|b|
!b.is_empty()),
status,
}
}
Err(e) => {
Error::Reqwest {
retries,
max_retries,
elapsed: now.elapsed(),
retry_timeout,
source: e,
}
}
}
false => Error::Reqwest {
retries,
max_retries,
elapsed: now.elapsed(),
retry_timeout,
source: e,
}
});
```
if there is a response body, we ultimately return a generic error with
source of type `object_store::client::retry::Error::Client`
Since `object_store::client::retry::Error` is crate private you cannot
downcast the source to this in client code and hence cannot access the status
code
**Describe the solution you'd like**
<!--
A clear and concise description of what you want to happen.
-->
The status code should be accessible since it can be important to error
handling logic in application code
**Describe alternatives you've considered**
<!--
A clear and concise description of any alternative solutions or features
you've considered.
-->
**Additional context**
<!--
Add any other context or screenshots about the feature request 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]