diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 72eddc3..601ecba 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -895,7 +895,7 @@ void S3FileHandle::Initialize(optional_ptr opener) { correct_region = new_region->second; } auto extra_text = S3FileSystem::GetS3BadRequestError(auth_params, correct_region); - 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 @@ -905,7 +905,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; @@ -941,13 +941,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()); } }