diff --git a/ecstore/src/error.rs b/ecstore/src/error.rs index 9224d0ff8..b5f9e01a2 100644 --- a/ecstore/src/error.rs +++ b/ecstore/src/error.rs @@ -832,40 +832,50 @@ pub fn error_resp_to_object_err(err: ErrorResponse, params: Vec<&str>) -> std::i /*S3ErrorCode::BucketAlreadyOwnedByYou => { err = Error::from(StorageError::BucketAlreadyOwnedByYou); }*/ - S3ErrorCode::BucketNotEmpty => std::io::Error::other(StorageError::BucketNotEmpty("".to_string()).to_string()), + S3ErrorCode::BucketNotEmpty => { + err = std::io::Error::other(StorageError::BucketNotEmpty("".to_string()).to_string()); + } /*S3ErrorCode::NoSuchBucketPolicy => { err = Error::from(StorageError::BucketPolicyNotFound); }*/ /*S3ErrorCode::NoSuchLifecycleConfiguration => { err = Error::from(StorageError::BucketLifecycleNotFound); }*/ - S3ErrorCode::InvalidBucketName => std::io::Error::other(StorageError::BucketNameInvalid(bucket)), - S3ErrorCode::InvalidPart => { - std::io::Error::other(StorageError::InvalidPart(0, bucket, object /* , version_id */)) + S3ErrorCode::InvalidBucketName => { + err = std::io::Error::other(StorageError::BucketNameInvalid(bucket)); + } + S3ErrorCode::InvalidPart => { + err = std::io::Error::other(StorageError::InvalidPart(0, bucket, object /* , version_id */)); + } + S3ErrorCode::NoSuchBucket => { + err = std::io::Error::other(StorageError::BucketNotFound(bucket)); } - S3ErrorCode::NoSuchBucket => std::io::Error::other(StorageError::BucketNotFound(bucket)), S3ErrorCode::NoSuchKey => { - if !object.is_empty() { - std::io::Error::other(StorageError::ObjectNotFound(bucket, object)) + if object != "" { + err = std::io::Error::other(StorageError::ObjectNotFound(bucket, object)); } else { - std::io::Error::other(StorageError::BucketNotFound(bucket)) + err = std::io::Error::other(StorageError::BucketNotFound(bucket)); } } S3ErrorCode::NoSuchVersion => { - if !object.is_empty() { - std::io::Error::other(StorageError::ObjectNotFound(bucket, object)); + if object != "" { + err = std::io::Error::other(StorageError::ObjectNotFound(bucket, object)); //, version_id); } else { - std::io::Error::other(StorageError::BucketNotFound(bucket)) + err = std::io::Error::other(StorageError::BucketNotFound(bucket)); } } /*S3ErrorCode::XRustFsInvalidObjectName => { err = Error::from(StorageError::ObjectNameInvalid(bucket, object)); }*/ - S3ErrorCode::AccessDenied => std::io::Error::other(StorageError::PrefixAccessDenied(bucket, object)), + S3ErrorCode::AccessDenied => { + err = std::io::Error::other(StorageError::PrefixAccessDenied(bucket, object)); + } /*S3ErrorCode::XAmzContentSHA256Mismatch => { err = hash.SHA256Mismatch{}; }*/ - S3ErrorCode::NoSuchUpload => std::io::Error::other(StorageError::InvalidUploadID(bucket, object, version_id)), + S3ErrorCode::NoSuchUpload => { + err = std::io::Error::other(StorageError::InvalidUploadID(bucket, object, version_id)); + } /*S3ErrorCode::EntityTooSmall => { err = std::io::Error::other(StorageError::PartTooSmall); }*/ diff --git a/rustfs/src/admin/handlers/tier.rs b/rustfs/src/admin/handlers/tier.rs index 3b691d2ce..745780ee4 100644 --- a/rustfs/src/admin/handlers/tier.rs +++ b/rustfs/src/admin/handlers/tier.rs @@ -393,7 +393,7 @@ impl Operation for GetTierInfo { } } -#[derive(Debug, Deserialize, Default)] +#[derive(Debug, serde::Deserialize, Default)] pub struct ClearTierQuery { pub rand: Option, pub force: String,