You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling S3Client.getBucketPolicy() on an S3 bucket that does not have a bucket policy, the resulting S3Exception and AwsErrorDetails have null values for the request id, error code and error message.
Expected Behavior
The S3Exception should capture error details from the response body. For reference, a partially redacted response body is as follows:
<?xml version="1.0" encoding="UTF-8"?><Policy><![CDATA[<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchBucketPolicy</Code><Message>The bucket policy does not exist</Message><BucketName>xxxx</BucketName><RequestId>xxxx</RequestId><HostId>xxxx</HostId></Error>]]></Policy>
Current Behavior
The request id, error code and error message are null.
Steps to Reproduce (for bugs)
try {
S3Client.create().getBucketPolicy(x -> x.bucket("my-bucket"));
}
catch (S3Exceptione) {
// prints "null" instead of the x-amz-request-id header valuelog.info(e.requestId());
// prints "null" instead of "The bucket policy does not exist"log.info(e.awsErrorDetails().errorMessage());
// prints "null" instead of "NoSuchBucketPolicy"log.info(e.awsErrorDetails().errorCode());
}
Your Environment
AWS Java SDK version used: 2.4.6
The text was updated successfully, but these errors were encountered:
When calling
S3Client.getBucketPolicy()
on an S3 bucket that does not have a bucket policy, the resultingS3Exception
andAwsErrorDetails
have null values for the request id, error code and error message.Expected Behavior
The S3Exception should capture error details from the response body. For reference, a partially redacted response body is as follows:
Current Behavior
The request id, error code and error message are null.
Steps to Reproduce (for bugs)
Your Environment
The text was updated successfully, but these errors were encountered: