Class HttpException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BadRequestException, ForbiddenException, InternalServerException, NotFoundException, UnauthorizedException

public class HttpException extends RuntimeException
Runtime exception for applications.

This exception may be thrown during request processing if a specific HTTP error response needs to be produced. Only effective if thrown before the status code is sent.

See Also:
  • Constructor Details

  • Method Details

    • status

      public final Http.Status status()
      Obtain the associated http status.
      Returns:
      the http status
    • keepAlive

      public boolean keepAlive()
      Whether we should attempt to keep the connection alive (if enabled for it). Some exceptions may allow the connection to be further used (such as NotFoundException.
      Returns:
      whether to keep alive