aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_errors.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-09-04 00:42:44 -0700
committerChris Lu <chris.lu@gmail.com>2018-09-04 00:42:44 -0700
commitce6a2140a2173ec4090a18d07b85e8c553bcb3a8 (patch)
treec1fe7bc40171caed9c951076cb679ae821c0abd7 /weed/s3api/s3api_errors.go
parent7f760f16b0d2f55e92c5d57ca2167edbc257cf54 (diff)
downloadseaweedfs-ce6a2140a2173ec4090a18d07b85e8c553bcb3a8.tar.xz
seaweedfs-ce6a2140a2173ec4090a18d07b85e8c553bcb3a8.zip
preparing to support S3 multipart uploads
Diffstat (limited to 'weed/s3api/s3api_errors.go')
-rw-r--r--weed/s3api/s3api_errors.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/weed/s3api/s3api_errors.go b/weed/s3api/s3api_errors.go
index e5ce8df5a..e9975dbb6 100644
--- a/weed/s3api/s3api_errors.go
+++ b/weed/s3api/s3api_errors.go
@@ -32,10 +32,17 @@ const (
ErrBucketAlreadyExists
ErrBucketAlreadyOwnedByYou
ErrNoSuchBucket
+ ErrNoSuchUpload
ErrInvalidBucketName
ErrInvalidDigest
ErrInvalidMaxKeys
+ ErrInvalidMaxUploads
+ ErrInvalidMaxParts
+ ErrInvalidPartNumberMarker
+ ErrInvalidPart
+ ErrInvalidPartOrder
ErrInternalError
+ ErrMalformedXML
ErrNotImplemented
)
@@ -72,21 +79,56 @@ var errorCodeResponse = map[ErrorCode]APIError{
Description: "The Content-Md5 you specified is not valid.",
HTTPStatusCode: http.StatusBadRequest,
},
+ ErrInvalidMaxUploads: {
+ Code: "InvalidArgument",
+ Description: "Argument max-uploads must be an integer between 0 and 2147483647",
+ HTTPStatusCode: http.StatusBadRequest,
+ },
ErrInvalidMaxKeys: {
Code: "InvalidArgument",
Description: "Argument maxKeys must be an integer between 0 and 2147483647",
HTTPStatusCode: http.StatusBadRequest,
},
+ ErrInvalidMaxParts: {
+ Code: "InvalidArgument",
+ Description: "Argument max-parts must be an integer between 0 and 2147483647",
+ HTTPStatusCode: http.StatusBadRequest,
+ },
+ ErrInvalidPartNumberMarker: {
+ Code: "InvalidArgument",
+ Description: "Argument partNumberMarker must be an integer.",
+ HTTPStatusCode: http.StatusBadRequest,
+ },
ErrNoSuchBucket: {
Code: "NoSuchBucket",
Description: "The specified bucket does not exist",
HTTPStatusCode: http.StatusNotFound,
},
+ ErrNoSuchUpload: {
+ Code: "NoSuchUpload",
+ Description: "The specified multipart upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.",
+ HTTPStatusCode: http.StatusNotFound,
+ },
ErrInternalError: {
Code: "InternalError",
Description: "We encountered an internal error, please try again.",
HTTPStatusCode: http.StatusInternalServerError,
},
+ ErrMalformedXML: {
+ Code: "MalformedXML",
+ Description: "The XML you provided was not well-formed or did not validate against our published schema.",
+ HTTPStatusCode: http.StatusBadRequest,
+ },
+ ErrInvalidPart: {
+ Code: "InvalidPart",
+ Description: "One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag.",
+ HTTPStatusCode: http.StatusBadRequest,
+ },
+ ErrInvalidPartOrder: {
+ Code: "InvalidPartOrder",
+ Description: "The list of parts was not in ascending order. The parts list must be specified in order by part number.",
+ HTTPStatusCode: http.StatusBadRequest,
+ },
ErrNotImplemented: {
Code: "NotImplemented",
Description: "A header you provided implies functionality that is not implemented",