Package org.zalando.riptide.problem
Class ProblemRoute
java.lang.Object
org.zalando.riptide.problem.ProblemRoute
-
Method Summary
Modifier and TypeMethodDescriptionstatic Route
Produces aroute
that dispatches on thecontent type
and recognisesapplication/problem+json
as well asapplication/x-problem+json
andapplication/x.problem+json
asproblems
andpropagates
them.static Route
problemHandling
(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional, ? extends Exception> consumer) Produces aroute
that dispatches on thecontent type
and recognisesapplication/problem+json
as well asapplication/x-problem+json
andapplication/x.problem+json
asproblems
and handles them given the supplied consumer.static Route
problemHandling
(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional, ? extends Exception> consumer, Route fallback) Produces aroute
that dispatches on thecontent type
and recognisesapplication/problem+json
as well asapplication/x-problem+json
andapplication/x.problem+json
asproblems
and handles them given the supplied consumer.static Route
problemHandling
(Route fallback) Produces aroute
that dispatches on thecontent type
and recognisesapplication/problem+json
as well asapplication/x-problem+json
andapplication/x.problem+json
asproblems
andpropagates
them.
-
Method Details
-
problemHandling
Produces aroute
that dispatches on thecontent type
and recognisesapplication/problem+json
as well asapplication/x-problem+json
andapplication/x.problem+json
asproblems
andpropagates
them.- 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 aroute
that dispatches on thecontent type
and recognisesapplication/problem+json
as well asapplication/x-problem+json
andapplication/x.problem+json
asproblems
and handles them given the supplied consumer.- Parameters:
consumer
- the exception handler- Returns:
- a route for handling problems dynamically
-
problemHandling
Produces aroute
that dispatches on thecontent type
and recognisesapplication/problem+json
as well asapplication/x-problem+json
andapplication/x.problem+json
asproblems
andpropagates
them. 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 aroute
that dispatches on thecontent type
and recognisesapplication/problem+json
as well asapplication/x-problem+json
andapplication/x.problem+json
asproblems
and 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
-