Skip to content

Commit 0d19085

Browse files
committed
Removed the unmatched exception and uncommon exceptions
1 parent efd1c70 commit 0d19085

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

multicloudj-common-aws/src/main/java/com/salesforce/multicloudj/common/aws/CommonErrorCodeMapping.java

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private CommonErrorCodeMapping() {
2424
// The common error codes as source of truth is here:
2525
// https://docs.aws.amazon.com/STS/latest/APIReference/CommonErrors.html
2626
// https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/CommonErrors.html
27-
// https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
27+
// These are errors that are common across multiple AWS services (STS, DynamoDB, etc.)
2828
ERROR_MAPPING = Map.ofEntries(
2929
// Common errors from STS/DynamoDB
3030
Map.entry("IncompleteSignature", InvalidArgumentException.class),
@@ -37,7 +37,7 @@ private CommonErrorCodeMapping() {
3737
Map.entry("ServiceUnavailable", UnknownException.class),
3838
Map.entry("ThrottlingException", ResourceExhaustedException.class),
3939
Map.entry("ValidationError", InvalidArgumentException.class),
40-
// All 403 Forbidden errors from S3
40+
// Common access/authorization errors
4141
Map.entry("AccessDenied", UnAuthorizedException.class),
4242
Map.entry("AccountNotAuthorized", UnAuthorizedException.class),
4343
Map.entry("AccountProblem", UnAuthorizedException.class),
@@ -48,28 +48,7 @@ private CommonErrorCodeMapping() {
4848
Map.entry("NotSignedUp", UnAuthorizedException.class),
4949
Map.entry("RequestTimeTooSkewed", InvalidArgumentException.class),
5050
Map.entry("SignatureDoesNotMatch", InvalidArgumentException.class),
51-
Map.entry("TokenRefreshRequired", UnAuthorizedException.class),
52-
// Common 400 Bad Request errors
53-
Map.entry("BadDigest", InvalidArgumentException.class),
54-
Map.entry("InvalidRequest", InvalidArgumentException.class),
55-
Map.entry("InvalidArgument", InvalidArgumentException.class),
56-
Map.entry("MalformedPolicy", InvalidArgumentException.class),
57-
Map.entry("MalformedXML", InvalidArgumentException.class),
58-
Map.entry("MetadataTooLarge", InvalidArgumentException.class),
59-
Map.entry("MissingContentLength", InvalidArgumentException.class),
60-
Map.entry("MissingSecurityHeader", InvalidArgumentException.class),
61-
Map.entry("RequestTimeout", ResourceExhaustedException.class),
62-
// Common 404 Not Found errors
63-
Map.entry("NoSuchKey", ResourceNotFoundException.class),
64-
Map.entry("NoSuchBucket", ResourceNotFoundException.class),
65-
Map.entry("NoSuchVersion", ResourceNotFoundException.class),
66-
Map.entry("NoSuchUpload", ResourceNotFoundException.class),
67-
// Common 409 Conflict errors
68-
Map.entry("BucketAlreadyExists", ResourceAlreadyExistsException.class),
69-
Map.entry("BucketAlreadyOwnedByYou", ResourceAlreadyExistsException.class),
70-
Map.entry("OperationAborted", ResourceConflictException.class),
71-
// Common 503 Service Unavailable errors
72-
Map.entry("SlowDown", ResourceExhaustedException.class)
51+
Map.entry("TokenRefreshRequired", UnAuthorizedException.class)
7352
);
7453
}
7554

0 commit comments

Comments
 (0)