Class ProblemRoute

java.lang.Object
org.zalando.riptide.problem.ProblemRoute

@API(status=STABLE) public final class ProblemRoute extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static Route
    Produces a route that dispatches on the content type and recognises application/problem+json as well as application/x-problem+json and application/x.problem+json as problems and propagates them.
    static Route
    problemHandling(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional,? extends Exception> consumer)
    Produces a route that dispatches on the content type and recognises application/problem+json as well as application/x-problem+json and application/x.problem+json as problems and handles them given the supplied consumer.
    static Route
    problemHandling(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional,? extends Exception> consumer, Route fallback)
    Produces a route that dispatches on the content type and recognises application/problem+json as well as application/x-problem+json and application/x.problem+json as problems and handles them given the supplied consumer.
    static Route
    Produces a route that dispatches on the content type and recognises application/problem+json as well as application/x-problem+json and application/x.problem+json as problems and propagates them.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • problemHandling

      public static Route problemHandling()
      Produces a route that dispatches on the content type and recognises application/problem+json as well as application/x-problem+json and application/x.problem+json as problems and propagates them.
      Returns:
      static route for handling problems by propagating them as exceptions
      See Also:
    • problemHandling

      public static Route problemHandling(org.zalando.fauxpas.ThrowingConsumer<org.zalando.problem.Exceptional,? extends Exception> consumer)
      Produces a route that dispatches on the content type and recognises application/problem+json as well as application/x-problem+json and application/x.problem+json as problems and handles them given the supplied consumer.
      Parameters:
      consumer - the exception handler
      Returns:
      a route for handling problems dynamically
    • problemHandling

      public static Route problemHandling(Route fallback)
      Produces a route that dispatches on the content type and recognises application/problem+json as well as application/x-problem+json and application/x.problem+json as problems and propagates 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 a route that dispatches on the content type and recognises application/problem+json as well as application/x-problem+json and application/x.problem+json as problems 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 handler
      fallback - the fallback route
      Returns:
      a route for handling problems dynamically