mirror of
https://github.com/rustfs/rustfs.git
synced 2026-01-17 01:30:33 +00:00
fix: when the error returned by make_bucket is BucketExists, replace … (#735)
* 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 <im@weisd.in>
This commit is contained in:
@@ -63,7 +63,7 @@ impl From<StorageError> 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),
|
||||
|
||||
Reference in New Issue
Block a user