Module io.avaje.jex
Package io.avaje.jex

Interface ErrorHandling


public interface ErrorHandling
  • Method Details

    • exception

      <T extends Exception> ErrorHandling exception​(Class<T> exceptionClass, ExceptionHandler<T> handler)
      Register an exception handler for the given exception type.
    • error

      ErrorHandling error​(int statusCode, Handler handler)
      Adds an error mapper to the instance. Useful for turning error-codes (404, 500) into standardized messages/pages
    • error

      ErrorHandling error​(int statusCode, String contentType, Handler handler)
      Adds an error mapper for the specified content-type to the instance. Useful for turning error-codes (404, 500) into standardized messages/pages
    • find

      <T extends Exception> ExceptionHandler<Exception> find​(Class<T> exceptionType)
      Return a registered exception handler given the exception type or null if one is not found.

      This includes searching the super types of the exception.