Merge branch '3.0.x' of ssh://git.cloud.com/var/lib/git/cloudstack-oss into 3.0.x

This commit is contained in:
Vijayendra Bhamidipati 2012-05-21 19:17:45 -07:00
commit e1b5eb6494
1 changed files with 10 additions and 1 deletions

View File

@ -170,7 +170,16 @@ public class CloudStackClient {
statusCode = ((HttpURLConnection)connect).getResponseCode();
if(statusCode >= 400) {
logger.error("Cloud API call + [" + url.toString() + "] failed with status code: " + statusCode);
throw new IOException("CloudStack API call HTTP response error, HTTP status code: " + statusCode);
String errorMessage = ((HttpURLConnection)connect).getResponseMessage();
if(errorMessage == null){
errorMessage = connect.getHeaderField("X-Description");
}
if(errorMessage == null){
errorMessage = "CloudStack API call HTTP response error, HTTP status code: " + statusCode;
}
throw new IOException(errorMessage);
}
InputStream inputStream = connect.getInputStream();