diff options
author | Alex Auvolat <alex@adnab.me> | 2022-01-12 12:43:33 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-01-24 21:04:40 +0100 |
commit | 6dab836f3a5646af4a06afa52338702d82c6eb9d (patch) | |
tree | ef2817d2453d4979bc9ab0e3381476277989bc34 /src/api/error.rs | |
parent | 513a6b15f99983c2054b95c6a17cebf672dbd360 (diff) | |
download | garage-6dab836f3a5646af4a06afa52338702d82c6eb9d.tar.gz garage-6dab836f3a5646af4a06afa52338702d82c6eb9d.zip |
Multipart improvements
- support part_number for HeadObject
- add checks in complete_multipart_upload
Diffstat (limited to 'src/api/error.rs')
-rw-r--r-- | src/api/error.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/api/error.rs b/src/api/error.rs index 8602cfdc..d945295a 100644 --- a/src/api/error.rs +++ b/src/api/error.rs @@ -58,6 +58,19 @@ pub enum Error { #[error(display = "At least one of the preconditions you specified did not hold")] PreconditionFailed, + /// Parts specified in CMU request do not match parts actually uploaded + #[error(display = "Parts given to CompleteMultipartUpload do not match uploaded parts")] + InvalidPart, + + /// Parts given to CompleteMultipartUpload were not in ascending order + #[error(display = "Parts given to CompleteMultipartUpload were not in ascending order")] + InvalidPartOrder, + + /// In CompleteMultipartUpload: not enough data + /// (here we are more lenient than AWS S3) + #[error(display = "Proposed upload is smaller than the minimum allowed object size")] + EntityTooSmall, + // Category: bad request /// The request contained an invalid UTF-8 sequence in its path or in other parameters #[error(display = "Invalid UTF-8: {}", _0)] @@ -143,6 +156,9 @@ impl Error { Error::BucketAlreadyExists => "BucketAlreadyExists", Error::BucketNotEmpty => "BucketNotEmpty", Error::PreconditionFailed => "PreconditionFailed", + Error::InvalidPart => "InvalidPart", + Error::InvalidPartOrder => "InvalidPartOrder", + Error::EntityTooSmall => "EntityTooSmall", Error::Forbidden(_) => "AccessDenied", Error::AuthorizationHeaderMalformed(_) => "AuthorizationHeaderMalformed", Error::NotImplemented(_) => "NotImplemented", |