b.append(exception.getStatusCode()).append(" with ");
Long contentLength = exception.getHeaders().getContentLength();
b.append(contentLength != null ? contentLength : Long.valueOf(0));
b.append(" bytes of content");
HttpHeaders headers = exception.getHeaders();
for (String name : headers.keySet()) {
b.append('\n').append(name).append(": ").append(headers.get(name));
}
b.append('\n').append(exception.getContent()).append('\n');
}