From 4d111274f5e455af86663a115d5bc2b02d2419be Mon Sep 17 00:00:00 2001 From: Adam Curtis Date: Sun, 6 Oct 2024 16:10:52 -0400 Subject: [PATCH] use Debug impl for generic Reqwest errors to provide more info see https://github.com/apache/arrow-rs/issues/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. --- object_store/src/aws/client.rs | 8 ++++---- object_store/src/client/retry.rs | 2 +- object_store/src/gcp/client.rs | 8 ++++---- object_store/src/http/client.rs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/object_store/src/aws/client.rs b/object_store/src/aws/client.rs index 6fe4889db176..aea309baf8ac 100644 --- a/object_store/src/aws/client.rs +++ b/object_store/src/aws/client.rs @@ -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))] @@ -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))] diff --git a/object_store/src/client/retry.rs b/object_store/src/client/retry.rs index 1fc689cdfd8d..9c7f0942c87f 100644 --- a/object_store/src/client/retry.rs +++ b/object_store/src/client/retry.rs @@ -39,7 +39,7 @@ pub enum Error { body: Option, }, - #[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, diff --git a/object_store/src/gcp/client.rs b/object_store/src/gcp/client.rs index 0045383ee000..f6ef3d0695f1 100644 --- a/object_store/src/gcp/client.rs +++ b/object_store/src/gcp/client.rs @@ -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))] @@ -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))] @@ -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))] @@ -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))] diff --git a/object_store/src/http/client.rs b/object_store/src/http/client.rs index 5def93120a68..5ae2a0526088 100644 --- a/object_store/src/http/client.rs +++ b/object_store/src/http/client.rs @@ -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))]