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
AwsServiceExceptions thrown by the CRT client are missing errorMessage and errorCode values, thus making them difficult to debug and programmatically handle.
Expected Behavior
AwsServiceException thrown by DefaultS3CrtAsyncClient should have AwsErrorDetails with correct errorCode and errorMessage values that match the vanilla client.
Example: AwsErrorDetails(errorMessage=Your key is too long, errorCode=KeyTooLongError, serviceName=S3)'
Current Behavior
AwsErrorDetails contains only the serviceName, and is missing errorCode and errorMessage
Example: AwsErrorDetails(serviceName=S3)
Reproduction Steps
public void reproS3Error() {
final S3AsyncClient vanillaClient = S3AsyncClient.builder()
.region(Region.US_EAST_1)
.credentialsProvider(Credentials.ADMIN)
.build();
final S3AsyncClient crtClient = S3AsyncClient.crtBuilder()
.region(Region.US_EAST_1)
.credentialsProvider(Credentials.ADMIN)
.build();
Consumer<S3AsyncClient> doRepro = (client) -> {
byte[] buf = new byte[1025];
Arrays.fill(buf, (byte) 1);
try {
client.getObject(GetObjectRequest.builder()
.bucket(BUCKET)
.key(new String(buf))
.build(),
new File("/tmp/foo").toPath()).join();
} catch (Throwable e) {
final AwsServiceException ex;
if (e instanceof AwsServiceException) {
ex = (AwsServiceException) e;
} else if (e.getCause() != null && e.getCause() instanceof AwsServiceException) {
ex = (AwsServiceException) e.getCause();
} else {
throw e;
}
final String clientName = client.getClass().getSimpleName();
System.out.println(clientName + " message: '" + ex.getMessage() + "'");
System.out.println(clientName + " awsErrorDetails: '" + ex.awsErrorDetails() + "'");
}
};
doRepro.accept(vanillaClient);
doRepro.accept(crtClient);
}
This prints:
DefaultS3AsyncClient message: 'Your key is too long (Service: S3, Status Code: 400, Request ID: <omitted>, Extended Request ID: <omitted>'
DefaultS3AsyncClient awsErrorDetails: 'AwsErrorDetails(errorMessage=Your key is too long, errorCode=KeyTooLongError, serviceName=S3)'
DefaultS3CrtAsyncClient message: 'null (Service: S3, Status Code: 400, Request ID: <omitted>, Extended Request ID: <omitted>)'
DefaultS3CrtAsyncClient awsErrorDetails: 'AwsErrorDetails(serviceName=S3)'
Possible Solution
AwsErrorDetails should be populated with the correct values.
Additional Information/Context
No response
aws-crt-java version used
1.0.x
Java version used
21
Operating System and version
MacOS 13.4.1
The text was updated successfully, but these errors were encountered:
Describe the bug
AwsServiceExceptions thrown by the CRT client are missing
errorMessage
anderrorCode
values, thus making them difficult to debug and programmatically handle.Expected Behavior
AwsServiceException
thrown byDefaultS3CrtAsyncClient
should haveAwsErrorDetails
with correcterrorCode
anderrorMessage
values that match the vanilla client.Example:
AwsErrorDetails(errorMessage=Your key is too long, errorCode=KeyTooLongError, serviceName=S3)'
Current Behavior
AwsErrorDetails
contains only theserviceName
, and is missingerrorCode
anderrorMessage
Example:
AwsErrorDetails(serviceName=S3)
Reproduction Steps
This prints:
Possible Solution
AwsErrorDetails should be populated with the correct values.
Additional Information/Context
No response
aws-crt-java version used
1.0.x
Java version used
21
Operating System and version
MacOS 13.4.1
The text was updated successfully, but these errors were encountered: