throw new IOException(errorMessage);
}
InputStream inputStream = connect.getInputStream();
JsonElement jsonElement = parser.parse(new InputStreamReader(inputStream));
if(jsonElement == null) {
logger.error("Cloud API call + [" + url.toString() + "] failed: unable to parse expected JSON response");
throw new IOException("CloudStack API call error : invalid JSON response");
}
if(logger.isDebugEnabled())
logger.debug("Cloud API call + [" + url.toString() + "] returned: " + jsonElement.toString());
return new JsonAccessor(jsonElement);
}