You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by al...@apache.org on 2025/06/11 20:17:47 UTC

(datafusion) branch main updated: Add more context to error message for datafusion-cli config failure (#16379)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new f8aad68841 Add more context to error message for datafusion-cli config failure (#16379)
f8aad68841 is described below

commit f8aad6884175a9852585b38c7f3a2eb0e697c9f6
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Wed Jun 11 16:17:44 2025 -0400

    Add more context to error message for datafusion-cli config failure (#16379)
---
 datafusion-cli/src/object_storage.rs | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/datafusion-cli/src/object_storage.rs b/datafusion-cli/src/object_storage.rs
index f203f9a008..01ba286096 100644
--- a/datafusion-cli/src/object_storage.rs
+++ b/datafusion-cli/src/object_storage.rs
@@ -16,6 +16,7 @@
 // under the License.
 
 use std::any::Any;
+use std::error::Error;
 use std::fmt::{Debug, Display};
 use std::sync::Arc;
 
@@ -148,10 +149,20 @@ impl CredentialsFromConfig {
             // other errors like `CredentialsError::InvalidConfiguration`
             // should be returned to the user so they can be fixed
             Err(e) => {
+                // Pass back underlying error to the user, including underlying source
+                let source_message = if let Some(source) = e.source() {
+                    format!(": {source}")
+                } else {
+                    String::new()
+                };
+
+                let message = format!(
+                    "Error getting credentials from provider: {e}{source_message}",
+                );
+
                 return Err(DataFusionError::ObjectStore(object_store::Error::Generic {
                     store: "S3",
-                    source: format!("Error getting credentials from provider: {e}")
-                        .into(),
+                    source: message.into(),
                 }));
             }
         };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org