From d2ced233e5f646e0c6820ea2680cce4f62f58291 Mon Sep 17 00:00:00 2001 From: "shiro.lee" <69624924+shiroleeee@users.noreply.github.com> Date: Tue, 28 Oct 2025 15:26:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20when=20the=20error=20returned=20by=20mak?= =?UTF-8?q?e=5Fbucket=20is=20BucketExists,=20replace=20=E2=80=A6=20(#735)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: when the error returned by make_bucket is BucketExists, replace BucketAlreadyExists with BucketAlreadyOwnedByYou (#719) * test: In the test_api_error_from_storage_error_mappings test method, modify the corresponding mapping relationships --------- Co-authored-by: weisd --- rustfs/src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rustfs/src/error.rs b/rustfs/src/error.rs index 4caaf063..19041a8b 100644 --- a/rustfs/src/error.rs +++ b/rustfs/src/error.rs @@ -63,7 +63,7 @@ impl From for ApiError { StorageError::BucketNotEmpty(_) => S3ErrorCode::BucketNotEmpty, StorageError::BucketNameInvalid(_) => S3ErrorCode::InvalidBucketName, StorageError::ObjectNameInvalid(_, _) => S3ErrorCode::InvalidArgument, - StorageError::BucketExists(_) => S3ErrorCode::BucketAlreadyExists, + StorageError::BucketExists(_) => S3ErrorCode::BucketAlreadyOwnedByYou, StorageError::StorageFull => S3ErrorCode::ServiceUnavailable, StorageError::SlowDown => S3ErrorCode::SlowDown, StorageError::PrefixAccessDenied(_, _) => S3ErrorCode::AccessDenied, @@ -210,7 +210,7 @@ mod tests { StorageError::ObjectNameInvalid("test".into(), "test".into()), S3ErrorCode::InvalidArgument, ), - (StorageError::BucketExists("test".into()), S3ErrorCode::BucketAlreadyExists), + (StorageError::BucketExists("test".into()), S3ErrorCode::BucketAlreadyOwnedByYou), (StorageError::StorageFull, S3ErrorCode::ServiceUnavailable), (StorageError::SlowDown, S3ErrorCode::SlowDown), (StorageError::PrefixAccessDenied("test".into(), "test".into()), S3ErrorCode::AccessDenied),