-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
enhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changelog
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
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
The status code should be accessible since it can be important to error handling logic in application code
Describe alternatives you've considered
Additional context
Metadata
Metadata
Assignees
Labels
enhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changelog