Modifier and Type | Method and Description |
---|---|
static <E extends Exception> |
internalServerError()
Utility method returning an async function that creates a
Response with status
Status.INTERNAL_SERVER_ERROR and the exception set as the cause. |
static Response |
newForbidden()
Generates an empty Forbidden response (403).
|
static Response |
newInternalServerError()
Generates an empty Internal Server Error response (500).
|
static Response |
newInternalServerError(Exception exception)
Generates an Internal Server Error response (500)
containing the cause of the error response.
|
static Response |
newNotFound()
Generates an empty Not Found response (404).
|
static <V,E extends Exception> |
noopExceptionFunction()
Utility method returning an empty function, whose goal is to ease the transformation of a
Promise type. |
static <E extends Exception> |
onExceptionInternalServerError()
Utility function that returns a
Response whose status is Status.INTERNAL_SERVER_ERROR and the
exception attached to the response as the cause. |
public static Response newInternalServerError()
public static Response newInternalServerError(Exception exception)
exception
- wrapped exceptionpublic static Response newNotFound()
public static Response newForbidden()
public static <V,E extends Exception> Function<NeverThrowsException,V,E> noopExceptionFunction()
Promise
type. Its main usage will be as the second argument in
Promise.then(Function, Function)
. The implementation of this function is just
to return null : as its name suggests it, an Exception
of type NeverThrowsException
will never
be thrown.V
- The expected type of that functionE
- The new Exception
that can be thrown by this function.Exception
.public static <E extends Exception> Function<E,Response,NeverThrowsException> onExceptionInternalServerError()
Response
whose status is Status.INTERNAL_SERVER_ERROR
and the
exception attached to the response as the cause.E
- The type of the incoming exceptionResponse
whose status is Status.INTERNAL_SERVER_ERROR
and the
exception attached to the response as the cause.public static <E extends Exception> AsyncFunction<E,Response,NeverThrowsException> internalServerError()
Response
with status
Status.INTERNAL_SERVER_ERROR
and the exception set as the cause.E
- The type of the incoming Exception
Response
with status Status.INTERNAL_SERVER_ERROR
and the exception set as the cause.Copyright © 2010-2018, ForgeRock All Rights Reserved.