Package org.zalando.riptide.problem
Class ProblemRoute
java.lang.Object
org.zalando.riptide.problem.ProblemRoute
-
Method Summary
Modifier and TypeMethodDescriptionstatic RouteProduces aroutethat dispatches on thecontent typeand recognisesapplication/problem+jsonas well asapplication/x-problem+jsonandapplication/x.problem+jsonasproblemsandpropagatesthem.static RouteproblemHandling(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional, ? extends Exception> consumer) Produces aroutethat dispatches on thecontent typeand recognisesapplication/problem+jsonas well asapplication/x-problem+jsonandapplication/x.problem+jsonasproblemsand handles them given the supplied consumer.static RouteproblemHandling(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional, ? extends Exception> consumer, Route fallback) Produces aroutethat dispatches on thecontent typeand recognisesapplication/problem+jsonas well asapplication/x-problem+jsonandapplication/x.problem+jsonasproblemsand handles them given the supplied consumer.static RouteproblemHandling(Route fallback) Produces aroutethat dispatches on thecontent typeand recognisesapplication/problem+jsonas well asapplication/x-problem+jsonandapplication/x.problem+jsonasproblemsandpropagatesthem.
-
Method Details
-
problemHandling
Produces aroutethat dispatches on thecontent typeand recognisesapplication/problem+jsonas well asapplication/x-problem+jsonandapplication/x.problem+jsonasproblemsandpropagatesthem.- Returns:
- static route for handling problems by propagating them as exceptions
- See Also:
-
problemHandling(ThrowingConsumer)Exceptional.propagate()
-
problemHandling
public static Route problemHandling(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional, ? extends Exception> consumer) Produces aroutethat dispatches on thecontent typeand recognisesapplication/problem+jsonas well asapplication/x-problem+jsonandapplication/x.problem+jsonasproblemsand handles them given the supplied consumer.- Parameters:
consumer- the exception handler- Returns:
- a route for handling problems dynamically
-
problemHandling
Produces aroutethat dispatches on thecontent typeand recognisesapplication/problem+jsonas well asapplication/x-problem+jsonandapplication/x.problem+jsonasproblemsandpropagatesthem. The given fallback will be used if none of the mentioned content types matches.- Parameters:
fallback- the fallback route- Returns:
- a route for handling problems dynamically
-
problemHandling
public static Route problemHandling(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional, ? extends Exception> consumer, Route fallback) Produces aroutethat dispatches on thecontent typeand recognisesapplication/problem+jsonas well asapplication/x-problem+jsonandapplication/x.problem+jsonasproblemsand handles them given the supplied consumer. The given fallback will be used if none of the mentioned content types matches.- Parameters:
consumer- the exception handlerfallback- the fallback route- Returns:
- a route for handling problems dynamically
-