/** * Attempts to convert an Exception to an ErrorResponse with an HTTP stauts code of {@code 403}. */ public HandlerResponse<T> unauthorizedErrorResponse(Exception e) { return createErrorResponse(e, HTTP_UNAUTHORIZED); }
/** * Attempts to convert an Exception to an ErrorResponse with an HTTP status code of {@code 401}. */ public HandlerResponse<T> unauthenticatedErrorResponse(Exception e) { return createErrorResponse(e, HTTP_UNAUTHENTICATED); }
/** * Attempts to convert an Exception to an ErrorResponse with an HTTP stauts code of {@code 403}. */ public HandlerResponse<T> unauthorizedErrorResponse(Exception e) { return createErrorResponse(e, HTTP_UNAUTHORIZED); }
/** * Attempts to convert an Exception to an ErrorResponse. If there is an issue in serialization, * a RuntimeException is thrown instead (wrapping the original exception if necessary). * * @param e The exception to convert. * @return A HandlerResponse instance. */ public HandlerResponse<T> convertToErrorResponse(Exception e) { return createErrorResponse(e, HTTP_INTERNAL_SERVER_ERROR); }
/** * Attempts to convert an Exception to an ErrorResponse. If there is an issue in serialization, * a RuntimeException is thrown instead (wrapping the original exception if necessary). * * @param e The exception to convert. * @return A HandlerResponse instance. */ public HandlerResponse<T> convertToErrorResponse(Exception e) { return createErrorResponse(e, HTTP_INTERNAL_SERVER_ERROR); }
/** * Attempts to convert an Exception to an ErrorResponse with an HTTP status code of {@code 401}. */ public HandlerResponse<T> unauthenticatedErrorResponse(Exception e) { return createErrorResponse(e, HTTP_UNAUTHENTICATED); }