fix(error): map StorageError::NotModified correctly (#4793)

fix(error): map not modified storage errors
This commit is contained in:
cxymds
2026-07-13 19:04:42 +08:00
committed by GitHub
parent f710f51687
commit 724d3ea0bc
+2
View File
@@ -269,6 +269,7 @@ impl From<StorageError> for ApiError {
StorageError::InvalidPart(_, _, _) => S3ErrorCode::InvalidPart,
StorageError::EntityTooSmall(_, _, _) => S3ErrorCode::EntityTooSmall,
StorageError::PreconditionFailed => S3ErrorCode::PreconditionFailed,
StorageError::NotModified => S3ErrorCode::NotModified,
StorageError::InvalidRangeSpec(_) => S3ErrorCode::InvalidRange,
_ => S3ErrorCode::InternalError,
};
@@ -478,6 +479,7 @@ mod tests {
(StorageError::VolumeNotFound, S3ErrorCode::NoSuchBucket),
(StorageError::FileNotFound, S3ErrorCode::NoSuchKey),
(StorageError::FileVersionNotFound, S3ErrorCode::NoSuchVersion),
(StorageError::NotModified, S3ErrorCode::NotModified),
(StorageError::MalformedUploadID("test".into()), S3ErrorCode::InvalidArgument),
(
StorageError::InvalidUploadID("bucket".into(), "object".into(), "uploadid".into()),