Fixed NPE in error handler

This commit is contained in:
Andrew Donald Kennedy 2012-04-11 01:06:17 +01:00
parent ef66989727
commit 9c40c3a34d
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ public class VCloudDirectorErrorHandler implements HttpErrorHandler {
String message = data != null
? new String(data)
: String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine());
Exception exception = new HttpResponseException(command, response, response.getPayload().getContentMetadata().getContentType());
Exception exception = new HttpResponseException(command, response, message);
// Try to create a VCloudDirectorException from XML payload
if (response.getPayload().getContentMetadata().getContentType().startsWith(VCloudDirectorMediaType.ERROR)) {