updated to accomodate application/unknown ec2 errors

This commit is contained in:
Adrian Cole 2010-09-14 23:51:03 -07:00
parent 0d7d2fe778
commit be69174a20
2 changed files with 3 additions and 2 deletions

View File

@ -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();

View File

@ -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",
"<Error><Code>InvalidGroup.Duplicate</Code></Error>", IllegalStateException.class);
}