@ExceptionHandler(ForbiddenException.class) @ResponseStatus(FORBIDDEN) private void handleForbiddenException(ForbiddenException ex) { LOGGER.info("Forbidden operation occurred : {}", ex.getMessage()); }
public Response toResponse(ForbiddenException exception) { Status currentStatus = Response.Status.FORBIDDEN; return Response.status(currentStatus).header("exception", exception.getMessage()).build(); }