List of usage examples for org.springframework.http.converter HttpMessageNotReadableException toString
public String toString()
From source file:com.orange.cepheus.cep.controller.AdminController.java
@ExceptionHandler({ HttpMessageNotReadableException.class })
public ResponseEntity<Object> messageNotReadableExceptionHandler(HttpServletRequest req,
HttpMessageNotReadableException exception) {
logger.error("Request not readable: {}", exception.toString());
StatusCode statusCode = new StatusCode();
statusCode.setCode("400");
statusCode.setReasonPhrase(exception.getMessage());
if (exception.getCause() != null) {
statusCode.setDetail(exception.getCause().getMessage());
}//from ww w. j av a 2s . c om
return new ResponseEntity<>(statusCode, HttpStatus.BAD_REQUEST);
}
From source file:com.orange.ngsi.server.NgsiBaseController.java
@ExceptionHandler({ HttpMessageNotReadableException.class })
public ResponseEntity<Object> messageNotReadableExceptionHandler(HttpServletRequest req,
HttpMessageNotReadableException exception) {
logger.error("Message not readable: {}", exception.toString());
return errorResponse(req.getRequestURI(), new StatusCode(CodeEnum.CODE_400));
}