String msg = null;
int statusCode = response.getStatusLine().getStatusCode();
String reasonPhrase = response.getStatusLine().getReasonPhrase();
URI requestUri = request.getURI();
try {
HandlerRaw handler = new HandlerRaw();
Object data = handler.parseContent(request, response, response.getEntity());
msg = "Request to url {0} returned an error response {1}:{2} {3}";
msg = StringUtil.format(msg, requestUri, statusCode, reasonPhrase, data);
} catch (Exception e) {
msg = "Request to url {0} returned an error response {1}:{2}";
msg = StringUtil.format(msg, requestUri, statusCode, reasonPhrase);