in src/java/detectors/aws_parse_error_message/AwsParseErrorMessage.java [33:46]
public void branchingCompliant() {
AmazonS3 s3Client = AmazonS3ClientBuilder.standard().withRegion(Regions.US_EAST_1).build();
try {
s3Client.doesObjectExist("bucketName", "key");
} catch (AmazonServiceException e) {
// Compliant: checks the status code of the exception instead of the status message.
if (e.getStatusCode() == 404){
log.info("The specified bucket does not exist.");
}
else {
log.info("Caught error: " + e.getMessage());
}
}
}