com.holonplatform.http.exceptions

## Class HttpStatusCodeException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - com.holonplatform.http.exceptions.HttpException
        - - com.holonplatform.http.exceptions.HttpStatusCodeException

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    UnsuccessfulResponseException

      public class HttpStatusCodeException
      extends HttpException

  `InvalidHttpMessageException` with HTTP status code.
  Since:
    5.0.0
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpStatusCodeException(int statusCode)` Constructor with status code
    `HttpStatusCodeException(int statusCode, String message)` Constructor with error message
    `HttpStatusCodeException(int statusCode, String message, Throwable cause)` Constructor with error message and nested exception
    `HttpStatusCodeException(int statusCode, Throwable cause)` Constructor with nested exception

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<HttpStatus>` | `getStatus()` Get HTTP response status associated with this exception as `HttpStatus`, if available and known.
    `int` | `getStatusCode()` Get the HTTP status code.

    - ### 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

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

- - ### Constructor Detail

    - #### HttpStatusCodeException

          public HttpStatusCodeException(int statusCode)

      Constructor with status code
      Parameters:
        `statusCode` - HTTP status code

    - #### HttpStatusCodeException

          public HttpStatusCodeException(int statusCode,
                                         String message)

      Constructor with error message
      Parameters:
        `statusCode` - HTTP status code
        `message` - Error message

    - #### HttpStatusCodeException

          public HttpStatusCodeException(int statusCode,
                                         Throwable cause)

      Constructor with nested exception
      Parameters:
        `statusCode` - HTTP status code
        `cause` - Nested exception

    - #### HttpStatusCodeException

          public HttpStatusCodeException(int statusCode,
                                         String message,
                                         Throwable cause)

      Constructor with error message and nested exception
      Parameters:
        `statusCode` - HTTP status code
        `message` - Error message
        `cause` - Nested exception

  - ### Method Detail

    - #### getStatusCode

          public int getStatusCode()

      Get the HTTP status code.
      Returns:
        the HTTP status code

    - #### getStatus

          public Optional<HttpStatus> getStatus()

      Get HTTP response status associated with this exception as `HttpStatus`, if available and known.
      Returns:
        Optional HTTP response status

Copyright © 2017 The Holon Platform. All rights reserved.