LOG.warn("Error stream from HTTP connection was null");
} else {
LOG.warn("Error stream from HTTP connection was not null. Attempting to get response text.");
setPostErrorResponse(IOUtils.toString(errorStream));
LOG.warn("Error text in response was '" + getPostErrorResponse() + "'");
throw new RestIOException(e, "Received error from server. Check the logs for more details.",
"Unable to get response from server. Error text was: " +
getPostErrorResponse(), getStatusCode(httpConnection));
}
} catch (IOException e2) {
LOG.warn("IOException encountered trying to read the reason for the previous IOException: "
+ e2.getMessage(), e2);
throw new RestIOException(e2, "Unable to read response from server.", getStatusCode(httpConnection));
}
}
throw new RestIOException(e, "Unable to read response from server.");
} finally {
if (outputWriter != null) {
try {
outputWriter.close();
} catch (IOException e) {