mirror of https://github.com/apache/jclouds.git
updated to accomodate application/unknown ec2 errors
This commit is contained in:
parent
0d7d2fe778
commit
be69174a20
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue