Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions datafusion-cli/src/object_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// under the License.

use std::any::Any;
use std::error::Error;
use std::fmt::{Debug, Display};
use std::sync::Arc;

Expand Down Expand Up @@ -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(),
}));
}
};
Expand Down