List of usage examples for org.springframework.web.client HttpServerErrorException getResponseBodyAsByteArray
public byte[] getResponseBodyAsByteArray()
From source file:io.syndesis.rest.v1.handler.exception.HttpServerErrorExceptionMapper.java
@Override public Response toResponse(HttpServerErrorException exception) { RestError error = new RestError(exception.getMessage(), exception.getMessage(), ErrorMap.from(new String(exception.getResponseBodyAsByteArray(), StandardCharsets.UTF_8)), exception.getStatusCode().value()); return Response.status(exception.getStatusCode().value()).type(MediaType.APPLICATION_JSON_TYPE) .entity(error).build();//from w ww .java2s . c o m }