Package io.micronaut.web.router
Interface ErrorRoute
- All Superinterfaces:
MethodBasedRoute
,Route
Represents a
Route
that matches an exception.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface io.micronaut.web.router.Route
DEFAULT_PRODUCES
-
Method Summary
Modifier and TypeMethodDescriptionApplies the given accepted media type the route.<T> Optional<RouteMatch<T>>
Match the given exception.<T> Optional<RouteMatch<T>>
Match the given exception.Defines routes nested within this route.Class<?>
Applies the given accepted media type the route.where
(Predicate<HttpRequest<?>> condition) Match thisRoute
only if the given predicate is true.Methods inherited from interface io.micronaut.web.router.MethodBasedRoute
getTargetMethod
Methods inherited from interface io.micronaut.web.router.Route
body, body, consumesAll, getConsumes, getProduces
-
Method Details
-
originatingType
Class<?> originatingType()- Returns:
- The type the exception originates from. Null if the error route is global.
-
exceptionType
- Returns:
- The type of exception
-
match
Match the given exception.- Type Parameters:
T
- The type- Parameters:
exception
- The exception to match- Returns:
- The route match
-
match
Match the given exception.- Type Parameters:
T
- The type- Parameters:
originatingClass
- The class where the error originates fromexception
- The exception to match- Returns:
- The route match
-
consumes
Description copied from interface:Route
Applies the given accepted media type the route. -
nest
Description copied from interface:Route
Defines routes nested within this route. -
where
Description copied from interface:Route
Match thisRoute
only if the given predicate is true.- Specified by:
where
in interfaceRoute
- Parameters:
condition
- The condition which accepts aHttpRequest
- Returns:
- This route
-
produces
Description copied from interface:Route
Applies the given accepted media type the route.
-