This commit is contained in:
likewu
2025-06-28 15:48:35 +08:00
parent 4d86866d61
commit f30345aaa8
2 changed files with 24 additions and 14 deletions
+23 -13
View File
@@ -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);
}*/
+1 -1
View File
@@ -393,7 +393,7 @@ impl Operation for GetTierInfo {
}
}
#[derive(Debug, Deserialize, Default)]
#[derive(Debug, serde::Deserialize, Default)]
pub struct ClearTierQuery {
pub rand: Option<String>,
pub force: String,