io.vertx.ext.web.handler

## Class HttpException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - io.vertx.ext.web.handler.HttpException

- All Implemented Interfaces:
    Serializable

      public final class HttpException
      extends RuntimeException

  An utility exception class to signal HTTP failures. The class with convey an http status code, by default is is `500`. The exception may contain a cause throwable and for special cases a simple payload string may be added for context. The payload can be used for example perform a redirect. The message for the exception is inferred from the standard http error code using `HttpResponseStatus`.
  Author:
    Paulo Lopes
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpException()`
    `HttpException(int statusCode)`
    `HttpException(int statusCode, String payload)`
    `HttpException(int statusCode, String payload, Throwable cause)`
    `HttpException(int statusCode, Throwable cause)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getPayload()`
    `int` | `getStatusCode()`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### HttpException

          public HttpException()

    - #### HttpException

          public HttpException(int statusCode)

    - #### HttpException

          public HttpException(int statusCode,
                               Throwable cause)

    - #### HttpException

          public HttpException(int statusCode,
                               String payload)

    - #### HttpException

          public HttpException(int statusCode,
                               String payload,
                               Throwable cause)

  - ### Method Detail

    - #### getStatusCode

          public int getStatusCode()

    - #### getPayload

          public String getPayload()

Copyright © 2025 Eclipse. All rights reserved.