public interface ErrorRoute extends MethodBasedRoute
Route
that matches an exception.DEFAULT_PRODUCES
Modifier and Type | Method and Description |
---|---|
ErrorRoute |
consumes(MediaType... mediaType)
Applies the given accepted media type the route.
|
java.lang.Class<? extends java.lang.Throwable> |
exceptionType() |
<T> java.util.Optional<RouteMatch<T>> |
match(java.lang.Class originatingClass,
java.lang.Throwable exception)
Match the given exception.
|
<T> java.util.Optional<RouteMatch<T>> |
match(java.lang.Throwable exception)
Match the given exception.
|
ErrorRoute |
nest(java.lang.Runnable nested)
Defines routes nested within this route.
|
java.lang.Class<?> |
originatingType() |
ErrorRoute |
produces(MediaType... mediaType)
Applies the given accepted media type the route.
|
ErrorRoute |
where(java.util.function.Predicate<HttpRequest<?>> condition)
Match this
Route only if the given predicate is true. |
getTargetMethod
acceptAll, body, body, consumesAll, getConsumes, getProduces
java.lang.Class<?> originatingType()
java.lang.Class<? extends java.lang.Throwable> exceptionType()
<T> java.util.Optional<RouteMatch<T>> match(java.lang.Throwable exception)
T
- The typeexception
- The exception to match<T> java.util.Optional<RouteMatch<T>> match(java.lang.Class originatingClass, java.lang.Throwable exception)
T
- The typeoriginatingClass
- The class where the error originates fromexception
- The exception to matchErrorRoute consumes(MediaType... mediaType)
Route
ErrorRoute nest(java.lang.Runnable nested)
Route
ErrorRoute where(java.util.function.Predicate<HttpRequest<?>> condition)
Route
Route
only if the given predicate is true.where
in interface Route
condition
- The condition which accepts a HttpRequest
ErrorRoute produces(MediaType... mediaType)
Route