diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 2a92f22..c7041e4 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -890,7 +890,7 @@ void S3FileHandle::Initialize(optional_ptr opener) { if (entry->second == "400") { // 400: BAD REQUEST auto extra_text = S3FileSystem::GetS3BadRequestError(auth_params); - throw Exception(error.Type(), error.RawMessage() + extra_text, extra_info); + throw Exception(extra_info, error.Type(), error.RawMessage() + extra_text); } if (entry->second == "403") { // 403: FORBIDDEN @@ -900,7 +900,7 @@ void S3FileHandle::Initialize(optional_ptr opener) { } else { extra_text = S3FileSystem::GetS3AuthError(auth_params); } - throw Exception(error.Type(), error.RawMessage() + extra_text, extra_info); + throw Exception(extra_info, error.Type(), error.RawMessage() + extra_text); } } throw; @@ -936,13 +936,13 @@ bool S3FileSystem::CanHandleFile(const string &fpath) { void S3FileSystem::RemoveFile(const string &path, optional_ptr opener) { auto handle = OpenFile(path, FileFlags::FILE_FLAGS_NULL_IF_NOT_EXISTS, opener); if (!handle) { - throw IOException("Could not remove file \"%s\": %s", {{"errno", "404"}}, path, "No such file or directory"); + throw IOException({{"errno", "404"}}, "Could not remove file \"%s\": %s", path, "No such file or directory"); } auto &s3fh = handle->Cast(); auto res = DeleteRequest(*handle, s3fh.path, {}); if (res->status != HTTPStatusCode::OK_200 && res->status != HTTPStatusCode::NoContent_204) { - throw IOException("Could not remove file \"%s\": %s", {{"errno", to_string(static_cast(res->status))}}, + throw IOException({{"errno", to_string(static_cast(res->status))}}, "Could not remove file \"%s\": %s", path, res->GetError()); } }