S3Errors.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. * SPDX-License-Identifier: Apache-2.0.
  4. */
  5. #pragma once
  6. #include <aws/core/client/AWSError.h>
  7. #include <aws/core/client/CoreErrors.h>
  8. #include <aws/s3/S3_EXPORTS.h>
  9. namespace Aws
  10. {
  11. namespace S3
  12. {
  13. enum class S3Errors
  14. {
  15. //From Core//
  16. //////////////////////////////////////////////////////////////////////////////////////////
  17. INCOMPLETE_SIGNATURE = 0,
  18. INTERNAL_FAILURE = 1,
  19. INVALID_ACTION = 2,
  20. INVALID_CLIENT_TOKEN_ID = 3,
  21. INVALID_PARAMETER_COMBINATION = 4,
  22. INVALID_QUERY_PARAMETER = 5,
  23. INVALID_PARAMETER_VALUE = 6,
  24. MISSING_ACTION = 7, // SDK should never allow
  25. MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
  26. MISSING_PARAMETER = 9, // SDK should never allow
  27. OPT_IN_REQUIRED = 10,
  28. REQUEST_EXPIRED = 11,
  29. SERVICE_UNAVAILABLE = 12,
  30. THROTTLING = 13,
  31. VALIDATION = 14,
  32. ACCESS_DENIED = 15,
  33. RESOURCE_NOT_FOUND = 16,
  34. UNRECOGNIZED_CLIENT = 17,
  35. MALFORMED_QUERY_STRING = 18,
  36. SLOW_DOWN = 19,
  37. REQUEST_TIME_TOO_SKEWED = 20,
  38. INVALID_SIGNATURE = 21,
  39. SIGNATURE_DOES_NOT_MATCH = 22,
  40. INVALID_ACCESS_KEY_ID = 23,
  41. REQUEST_TIMEOUT = 24,
  42. NETWORK_CONNECTION = 99,
  43. UNKNOWN = 100,
  44. ///////////////////////////////////////////////////////////////////////////////////////////
  45. BUCKET_ALREADY_EXISTS= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
  46. BUCKET_ALREADY_OWNED_BY_YOU,
  47. INVALID_OBJECT_STATE,
  48. NO_SUCH_BUCKET,
  49. NO_SUCH_KEY,
  50. NO_SUCH_UPLOAD,
  51. OBJECT_ALREADY_IN_ACTIVE_TIER,
  52. OBJECT_NOT_IN_ACTIVE_TIER
  53. };
  54. class AWS_S3_API S3Error : public Aws::Client::AWSError<S3Errors>
  55. {
  56. public:
  57. S3Error() {}
  58. S3Error(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<S3Errors>(rhs) {}
  59. S3Error(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<S3Errors>(rhs) {}
  60. S3Error(const Aws::Client::AWSError<S3Errors>& rhs) : Aws::Client::AWSError<S3Errors>(rhs) {}
  61. S3Error(Aws::Client::AWSError<S3Errors>&& rhs) : Aws::Client::AWSError<S3Errors>(rhs) {}
  62. template <typename T>
  63. T GetModeledError();
  64. };
  65. namespace S3ErrorMapper
  66. {
  67. AWS_S3_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
  68. }
  69. } // namespace S3
  70. } // namespace Aws