Interface ErrorHandler

All Known Implementing Classes:
DefaultErrorHandler

public interface ErrorHandler
This interface allows you to define the behaviour to have when an error occurs.
  • Method Details

    • onBadRequest

      Result onBadRequest(Context context, HttpException.BadRequest badRequestException)
      This method is called when the provided request is invalid.
      Parameters:
      context - The current context
      badRequestException - The cause (OPTIONAL)
      Returns:
      A result
    • onNotFound

      Result onNotFound(Context context, HttpException.NotFound notFoundException)
      This method is called when no route has been found to satisfy the request.
      Parameters:
      context - The current context
      notFoundException - The cause (OPTIONAL)
      Returns:
      A result
    • onServerError

      Result onServerError(Context context, Throwable throwable)
      This method is called when an unexpected error occurs during the processing of the request.
      Parameters:
      context - The current context
      throwable - The cause
      Returns:
      A result