| 108 | } |
| 109 | |
| 110 | inline std::string S3ErrorToString(Aws::S3::S3Errors error_type) { |
| 111 | switch (error_type) { |
| 112 | #define S3_ERROR_CASE(NAME) \ |
| 113 | case Aws::S3::S3Errors::NAME: \ |
| 114 | return #NAME; |
| 115 | |
| 116 | S3_ERROR_CASE(INCOMPLETE_SIGNATURE) |
| 117 | S3_ERROR_CASE(INTERNAL_FAILURE) |
| 118 | S3_ERROR_CASE(INVALID_ACTION) |
| 119 | S3_ERROR_CASE(INVALID_CLIENT_TOKEN_ID) |
| 120 | S3_ERROR_CASE(INVALID_PARAMETER_COMBINATION) |
| 121 | S3_ERROR_CASE(INVALID_QUERY_PARAMETER) |
| 122 | S3_ERROR_CASE(INVALID_PARAMETER_VALUE) |
| 123 | S3_ERROR_CASE(MISSING_ACTION) |
| 124 | S3_ERROR_CASE(MISSING_AUTHENTICATION_TOKEN) |
| 125 | S3_ERROR_CASE(MISSING_PARAMETER) |
| 126 | S3_ERROR_CASE(OPT_IN_REQUIRED) |
| 127 | S3_ERROR_CASE(REQUEST_EXPIRED) |
| 128 | S3_ERROR_CASE(SERVICE_UNAVAILABLE) |
| 129 | S3_ERROR_CASE(THROTTLING) |
| 130 | S3_ERROR_CASE(VALIDATION) |
| 131 | S3_ERROR_CASE(ACCESS_DENIED) |
| 132 | S3_ERROR_CASE(RESOURCE_NOT_FOUND) |
| 133 | S3_ERROR_CASE(UNRECOGNIZED_CLIENT) |
| 134 | S3_ERROR_CASE(MALFORMED_QUERY_STRING) |
| 135 | S3_ERROR_CASE(SLOW_DOWN) |
| 136 | S3_ERROR_CASE(REQUEST_TIME_TOO_SKEWED) |
| 137 | S3_ERROR_CASE(INVALID_SIGNATURE) |
| 138 | S3_ERROR_CASE(SIGNATURE_DOES_NOT_MATCH) |
| 139 | S3_ERROR_CASE(INVALID_ACCESS_KEY_ID) |
| 140 | S3_ERROR_CASE(REQUEST_TIMEOUT) |
| 141 | S3_ERROR_CASE(NETWORK_CONNECTION) |
| 142 | S3_ERROR_CASE(UNKNOWN) |
| 143 | S3_ERROR_CASE(BUCKET_ALREADY_EXISTS) |
| 144 | S3_ERROR_CASE(BUCKET_ALREADY_OWNED_BY_YOU) |
| 145 | // The following is the most recent addition to S3Errors |
| 146 | // and is not supported yet for some versions of the SDK |
| 147 | // that Apache Arrow is using. This is not a big deal |
| 148 | // since this error will happen only in very specialized |
| 149 | // settings and we will print the correct numerical error |
| 150 | // code as per the "default" case down below. We should |
| 151 | // put it back once the SDK has been upgraded in all |
| 152 | // Apache Arrow build configurations. |
| 153 | // S3_ERROR_CASE(INVALID_OBJECT_STATE) |
| 154 | S3_ERROR_CASE(NO_SUCH_BUCKET) |
| 155 | S3_ERROR_CASE(NO_SUCH_KEY) |
| 156 | S3_ERROR_CASE(NO_SUCH_UPLOAD) |
| 157 | S3_ERROR_CASE(OBJECT_ALREADY_IN_ACTIVE_TIER) |
| 158 | S3_ERROR_CASE(OBJECT_NOT_IN_ACTIVE_TIER) |
| 159 | |
| 160 | #undef S3_ERROR_CASE |
| 161 | default: |
| 162 | return "[code " + ::arrow::internal::ToChars(static_cast<int>(error_type)) + "]"; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | // TODO qualify error messages with a prefix indicating context |
| 167 | // (e.g. "When completing multipart upload to bucket 'xxx', key 'xxx': ...") |
no test coverage detected