diff --git a/aws/core/src/main/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java b/aws/core/src/main/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java index 6c84464379..b4b06978cb 100755 --- a/aws/core/src/main/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java +++ b/aws/core/src/main/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java @@ -71,7 +71,8 @@ public class ParseAWSErrorFromXmlContent implements HttpErrorHandler { AWSError error = null; String message = null; if (response.getPayload().getContentType() != null - && response.getPayload().getContentType().indexOf("xml") != -1) { + && (response.getPayload().getContentType().indexOf("xml") != -1 || response.getPayload() + .getContentType().indexOf("unknown") != -1)) { error = utils.parseAWSErrorFromContent(request, response); if (error != null) { message = error.getMessage(); diff --git a/aws/core/src/test/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContentTest.java b/aws/core/src/test/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContentTest.java index 3b9ca782a7..de6081daaa 100644 --- a/aws/core/src/test/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContentTest.java +++ b/aws/core/src/test/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContentTest.java @@ -71,7 +71,7 @@ public class ParseAWSErrorFromXmlContentTest { @Test public void test400WithInvalidGroupDuplicateIllegalStateException() { - assertCodeMakes("GET", URI.create("https://amazonaws.com/foo"), 400, "", + assertCodeMakes("GET", URI.create("https://amazonaws.com/foo"), 400,"Bad Request", "application/unknown", "InvalidGroup.Duplicate", IllegalStateException.class); }