Interface ErrorRoute

    • Method Detail

      • originatingType

        java.lang.Class<?> originatingType()
        Returns:
        The type the exception originates from. Null if the error route is global.
      • exceptionType

        java.lang.Class<? extends java.lang.Throwable> exceptionType()
        Returns:
        The type of exception
      • match

        <T> java.util.Optional<RouteMatch<T>> match​(java.lang.Throwable exception)
        Match the given exception.
        Type Parameters:
        T - The type
        Parameters:
        exception - The exception to match
        Returns:
        The route match
      • match

        <T> java.util.Optional<RouteMatch<T>> match​(java.lang.Class originatingClass,
                                                    java.lang.Throwable exception)
        Match the given exception.
        Type Parameters:
        T - The type
        Parameters:
        originatingClass - The class where the error originates from
        exception - The exception to match
        Returns:
        The route match
      • consumes

        ErrorRoute consumes​(io.micronaut.http.MediaType... mediaType)
        Description copied from interface: Route
        Applies the given accepted media type the route.
        Specified by:
        consumes in interface Route
        Parameters:
        mediaType - The media type
        Returns:
        A new route with the media type applied
      • nest

        ErrorRoute nest​(java.lang.Runnable nested)
        Description copied from interface: Route
        Defines routes nested within this route.
        Specified by:
        nest in interface Route
        Parameters:
        nested - The nested routes
        Returns:
        This route
      • where

        ErrorRoute where​(java.util.function.Predicate<io.micronaut.http.HttpRequest<?>> condition)
        Description copied from interface: Route
        Match this Route only if the given predicate is true.
        Specified by:
        where in interface Route
        Parameters:
        condition - The condition which accepts a HttpRequest
        Returns:
        This route
      • produces

        ErrorRoute produces​(io.micronaut.http.MediaType... mediaType)
        Description copied from interface: Route
        Applies the given accepted media type the route.
        Specified by:
        produces in interface Route
        Parameters:
        mediaType - The media type
        Returns:
        A new route with the media type applied