Skip to content

Commit

Permalink
use Debug impl for generic Reqwest errors to provide more info
Browse files Browse the repository at this point in the history
see apache#6377

This should help in the interim to identify specific causes of, sometimes confusing, network
related errors. I think this change should be temporary until we can find a better way to
improve error messages.
  • Loading branch information
erratic-pattern committed Oct 6, 2024
1 parent 3293a8c commit 4d11127
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions object_store/src/aws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub(crate) enum Error {
message: String,
},

#[snafu(display("Error getting DeleteObjects response body: {}", source))]
#[snafu(display("Error getting DeleteObjects response body: {:?}", source))]
DeleteObjectsResponse { source: reqwest::Error },

#[snafu(display("Got invalid DeleteObjects response: {}", source))]
Expand All @@ -93,16 +93,16 @@ pub(crate) enum Error {
#[snafu(display("Error performing list request: {}", source))]
ListRequest { source: crate::client::retry::Error },

#[snafu(display("Error getting list response body: {}", source))]
#[snafu(display("Error getting list response body: {:?}", source))]
ListResponseBody { source: reqwest::Error },

#[snafu(display("Error getting create multipart response body: {}", source))]
#[snafu(display("Error getting create multipart response body: {:?}", source))]
CreateMultipartResponseBody { source: reqwest::Error },

#[snafu(display("Error performing complete multipart request: {}", source))]
CompleteMultipartRequest { source: crate::client::retry::Error },

#[snafu(display("Error getting complete multipart response body: {}", source))]
#[snafu(display("Error getting complete multipart response body: {:?}", source))]
CompleteMultipartResponseBody { source: reqwest::Error },

#[snafu(display("Got invalid list response: {}", source))]
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/client/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum Error {
body: Option<String>,
},

#[snafu(display("Error after {retries} retries in {elapsed:?}, max_retries:{max_retries}, retry_timeout:{retry_timeout:?}, source:{source}"))]
#[snafu(display("Error after {retries} retries in {elapsed:?}, max_retries:{max_retries}, retry_timeout:{retry_timeout:?}, source:{source:?}"))]
Reqwest {
retries: usize,
max_retries: usize,
Expand Down
8 changes: 4 additions & 4 deletions object_store/src/gcp/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ enum Error {
#[snafu(display("Error performing list request: {}", source))]
ListRequest { source: crate::client::retry::Error },

#[snafu(display("Error getting list response body: {}", source))]
#[snafu(display("Error getting list response body: {:?}", source))]
ListResponseBody { source: reqwest::Error },

#[snafu(display("Got invalid list response: {}", source))]
Expand All @@ -76,7 +76,7 @@ enum Error {
path: String,
},

#[snafu(display("Error getting put response body: {}", source))]
#[snafu(display("Error getting put response body: {:?}", source))]
PutResponseBody { source: reqwest::Error },

#[snafu(display("Got invalid put response: {}", source))]
Expand All @@ -93,7 +93,7 @@ enum Error {
#[snafu(display("Error performing complete multipart request: {}", source))]
CompleteMultipartRequest { source: crate::client::retry::Error },

#[snafu(display("Error getting complete multipart response body: {}", source))]
#[snafu(display("Error getting complete multipart response body: {:?}", source))]
CompleteMultipartResponseBody { source: reqwest::Error },

#[snafu(display("Got invalid multipart response: {}", source))]
Expand All @@ -102,7 +102,7 @@ enum Error {
#[snafu(display("Error signing blob: {}", source))]
SignBlobRequest { source: crate::client::retry::Error },

#[snafu(display("Got invalid signing blob response: {}", source))]
#[snafu(display("Got invalid signing blob response: {:?}", source))]
InvalidSignBlobResponse { source: reqwest::Error },

#[snafu(display("Got invalid signing blob signature: {}", source))]
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ enum Error {
#[snafu(display("Request error: {}", source))]
Request { source: retry::Error },

#[snafu(display("Request error: {}", source))]
#[snafu(display("Request error: {:?}", source))]
Reqwest { source: reqwest::Error },

#[snafu(display("Range request not supported by {}", href))]
Expand Down

0 comments on commit 4d11127

Please sign in to comment.