s3-error.go 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * MinIO Go Library for Amazon S3 Compatible Cloud Storage
  3. * Copyright 2015-2017 MinIO, Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package minio
  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. }