mirror of https://github.com/apache/cloudstack.git
Merge branch '3.0.x' of ssh://git.cloud.com/var/lib/git/cloudstack-oss into 3.0.x
This commit is contained in:
commit
e1b5eb6494
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue