private static ResponseEntity<ExceptionMessage> badRequest(HttpHeaders headers, Exception throwable) { return errorResponse(HttpStatus.BAD_REQUEST, headers, throwable); }
/** * Handle failures commonly thrown from code tries to read incoming data and convert or cast it to the right type by * returning {@code 500 Internal Server Error} and the thrown exception marshalled into JSON. * * @param o_O the exception to handle. * @return */ @ExceptionHandler({ InvocationTargetException.class, IllegalArgumentException.class, ClassCastException.class, ConversionFailedException.class, NullPointerException.class }) ResponseEntity<ExceptionMessage> handleMiscFailures(Exception o_O) { return errorResponse(HttpStatus.INTERNAL_SERVER_ERROR, new HttpHeaders(), o_O); }
/** * Send a {@code 409 Conflict} in case of concurrent modification. * * @param o_O the exception to handle. * @return */ @ExceptionHandler({ OptimisticLockingFailureException.class, DataIntegrityViolationException.class }) ResponseEntity<ExceptionMessage> handleConflict(Exception o_O) { return errorResponse(HttpStatus.CONFLICT, new HttpHeaders(), o_O); }
private static ResponseEntity<ExceptionMessage> badRequest(HttpHeaders headers, Exception throwable) { return errorResponse(HttpStatus.BAD_REQUEST, headers, throwable); }
/** * Send a {@code 409 Conflict} in case of concurrent modification. * * @param o_O the exception to handle. * @return */ @ExceptionHandler({ OptimisticLockingFailureException.class, DataIntegrityViolationException.class }) ResponseEntity<ExceptionMessage> handleConflict(Exception o_O) { return errorResponse(HttpStatus.CONFLICT, new HttpHeaders(), o_O); }
/** * Handle failures commonly thrown from code tries to read incoming data and convert or cast it to the right type by * returning {@code 500 Internal Server Error} and the thrown exception marshalled into JSON. * * @param o_O the exception to handle. * @return */ @ExceptionHandler({ InvocationTargetException.class, IllegalArgumentException.class, ClassCastException.class, ConversionFailedException.class, NullPointerException.class }) ResponseEntity<ExceptionMessage> handleMiscFailures(Exception o_O) { return errorResponse(HttpStatus.INTERNAL_SERVER_ERROR, new HttpHeaders(), o_O); }