I want to access my request body data inside my exception handler method.
This is my endpoint code :
@RequestMapping( value = "/items", consumes = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE )
@ResponseBody
public ResponseEntity<?> uploadItems( @RequestBody final List<ItemVO> l_items )
throws ResourceAccessException, UnrecoverableException, NonFunctionalException, DataLockException, FunctionalException, Exception {
// code here
}
Now i want to access my l_items data inside my exception handler method :
@ExceptionHandler(Exception.class)
public ResponseEntity<?> fireWSException(Exception ex , final HttpServletRequest request)
{
ErrorWSResponse errorResponse = new ErrorWSResponse();
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
}
Who has an idea how can i do this please ?