s3-error.go 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package s3err
  2. /*
  3. * MinIO Go Library for Amazon S3 Compatible Cloud Storage
  4. * Copyright 2015-2017 MinIO, Inc.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. // Non exhaustive list of AWS S3 standard error responses -
  19. // http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
  20. var s3ErrorResponseMap = map[string]string{
  21. "AccessDenied": "Access Denied.",
  22. "BadDigest": "The Content-Md5 you specified did not match what we received.",
  23. "EntityTooSmall": "Your proposed upload is smaller than the minimum allowed object size.",
  24. "EntityTooLarge": "Your proposed upload exceeds the maximum allowed object size.",
  25. "IncompleteBody": "You did not provide the number of bytes specified by the Content-Length HTTP header.",
  26. "InternalError": "We encountered an internal error, please try again.",
  27. "InvalidAccessKeyId": "The access key ID you provided does not exist in our records.",
  28. "InvalidBucketName": "The specified bucket is not valid.",
  29. "InvalidDigest": "The Content-Md5 you specified is not valid.",
  30. "InvalidRange": "The requested range is not satisfiable",
  31. "MalformedXML": "The XML you provided was not well-formed or did not validate against our published schema.",
  32. "MissingContentLength": "You must provide the Content-Length HTTP header.",
  33. "MissingContentMD5": "Missing required header for this request: Content-Md5.",
  34. "MissingRequestBodyError": "Request body is empty.",
  35. "NoSuchBucket": "The specified bucket does not exist.",
  36. "NoSuchBucketPolicy": "The bucket policy does not exist",
  37. "NoSuchKey": "The specified key does not exist.",
  38. "NoSuchUpload": "The specified multipart upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.",
  39. "NotImplemented": "A header you provided implies functionality that is not implemented",
  40. "PreconditionFailed": "At least one of the pre-conditions you specified did not hold",
  41. "RequestTimeTooSkewed": "The difference between the request time and the server's time is too large.",
  42. "SignatureDoesNotMatch": "The request signature we calculated does not match the signature you provided. Check your key and signing method.",
  43. "MethodNotAllowed": "The specified method is not allowed against this resource.",
  44. "InvalidPart": "One or more of the specified parts could not be found.",
  45. "InvalidPartOrder": "The list of parts was not in ascending order. The parts list must be specified in order by part number.",
  46. "InvalidObjectState": "The operation is not valid for the current state of the object.",
  47. "AuthorizationHeaderMalformed": "The authorization header is malformed; the region is wrong.",
  48. "MalformedPOSTRequest": "The body of your POST request is not well-formed multipart/form-data.",
  49. "BucketNotEmpty": "The bucket you tried to delete is not empty",
  50. "AllAccessDisabled": "All access to this bucket has been disabled.",
  51. "MalformedPolicy": "Policy has invalid resource.",
  52. "MissingFields": "Missing fields in request.",
  53. "AuthorizationQueryParametersError": "Error parsing the X-Amz-Credential parameter; the Credential is mal-formed; expecting \"<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request\".",
  54. "MalformedDate": "Invalid date format header, expected to be in ISO8601, RFC1123 or RFC1123Z time format.",
  55. "BucketAlreadyOwnedByYou": "Your previous request to create the named bucket succeeded and you already own it.",
  56. "InvalidDuration": "Duration provided in the request is invalid.",
  57. "XAmzContentSHA256Mismatch": "The provided 'x-amz-content-sha256' header does not match what was computed.",
  58. // Add new API errors here.
  59. "NoSuchCORSConfiguration": "The CORS configuration does not exist",
  60. }