Class RequestException

All Implemented Interfaces:
Serializable

public class RequestException extends RuntimeException
Exception that will be handled by DirectHandler, unless server request and server response are already available, in which case it would be handled by appropriate error handler of routing. This exception is not used by clients.
See Also:
  • Constructor Details

    • RequestException

      protected RequestException(RequestException.Builder builder)
      A new exception with a predefined status, even type. Additional information may be added to simplify handling.
      Parameters:
      builder - builder with details to create this instance
  • Method Details

    • builder

      public static RequestException.Builder builder()
      Builder to set up a new HTTP exception.
      Returns:
      builder
    • status

      public Status status()
      Configured HTTP status.
      Returns:
      status
    • eventType

      public DirectHandler.EventType eventType()
      Event type of this exception.
      Returns:
      event type
    • request

      Transport request with as much information as is available.
      Returns:
      request
    • keepAlive

      public boolean keepAlive()
      Whether to attempt to keep connection alive.
      Returns:
      whether to keep connection alive
    • responseHeaders

      public ServerResponseHeaders responseHeaders()
      Response headers that should be added to response.
      Returns:
      response headers
    • safeMessage

      public boolean safeMessage()
      Safe message flag used to control which messages can be sent as part of a response and which should only be logged by the server.
      Returns:
      safe message flag