@Override public BackgroundException map(final GenericException e) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, e.getMessage()); final StatusLine status = e.getHttpStatusLine(); if(null != status) { this.append(buffer, String.format("%d %s", status.getStatusCode(), status.getReasonPhrase())); } switch(e.getHttpStatusCode()) { case HttpStatus.SC_BAD_REQUEST: return new LoginFailureException(buffer.toString(), e); } return new HttpResponseExceptionMappingService().map(new HttpResponseException(e.getHttpStatusCode(), buffer.toString())); } }