-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: unwrap CompletionException in default client, rethrow as S3Encry… #162
Conversation
…ptionClientException
} catch (CompletionException e) { | ||
throw new S3EncryptionClientException(e.getCause().getMessage(), e.getCause()); | ||
} catch (Exception e) { | ||
throw new S3EncryptionClientException("Unable to delete objects.", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the error message here is wrong for this method createMultipartUpload
. Instead, we should be throwing e.getMessage()
.
} catch (CompletionException e) { | ||
throw new S3EncryptionClientException(e.getCause().getMessage(), e.getCause()); | ||
} catch (Exception e) { | ||
throw new S3EncryptionClientException("Unable to delete objects.", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, the error message here is wrong for this method uploadPart
. Instead, we should be throwing e.getMessage()
.
} catch (CompletionException e) { | ||
throw new S3EncryptionClientException(e.getCause().getMessage(), e.getCause()); | ||
} catch (Exception e) { | ||
throw new S3EncryptionClientException("Unable to delete objects.", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, the error message here is wrong for this method completeMultipartUpload
. Instead, we should be throwing e.getMessage()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
### [3.0.1](v3.0.0...v3.0.1) (2023-06-01) ### Maintenance * add metadata downgrade tests([#55](#55)) ([0fed900](0fed900)) * fix some issues with release ([#156](#156)) ([c6b4e64](c6b4e64)) ### Fixes * null check for InputStream in ApiNameVersion ([#161](#161)) ([c23aeb2](c23aeb2)) * unwrap CompletionException in default client, rethrow as S3Encry… ([#162](#162)) ([1a00d3e](1a00d3e))
…ptionClientException
Issue #, if available: #160
Description of changes: The "default" (non-async) S3 Encryption Client implementation is to block on the async API. In all of the operations (except
getObject
), the client does not unwrap theCompletionException
which the async API wraps any failure with. The default API is expected to not be async, so it should not throwCompletionException
. Furthermore, S3EC v3 moves to wrapping exceptions inS3EncryptionClientException
(and its subclasses) so the correct behavior is to unwrapCompletionException
and rethrow the actual exception wrapped inS3EncryptionClientException
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Check any applicable: