Class HttpStatusCodeException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpClientErrorException, HttpServerErrorException

public abstract class HttpStatusCodeException extends RestClientResponseException
Abstract base class for exceptions based on an HttpStatusCode.
Since:
3.0
Author:
Arjen Poutsma, Chris Beams, Rossen Stoyanchev
See Also:
  • Constructor Details

    • HttpStatusCodeException

      protected HttpStatusCodeException(HttpStatusCode statusCode)
      Construct a new instance with an HttpStatusCode.
      Parameters:
      statusCode - the status code
    • HttpStatusCodeException

      protected HttpStatusCodeException(HttpStatusCode statusCode, String statusText)
      Construct a new instance with an HttpStatusCode and status text.
      Parameters:
      statusCode - the status code
      statusText - the status text
    • HttpStatusCodeException

      protected HttpStatusCodeException(HttpStatusCode statusCode, String statusText, @Nullable byte[] responseBody, @Nullable Charset responseCharset)
      Construct instance with an HttpStatusCode, status text, and content.
      Parameters:
      statusCode - the status code
      statusText - the status text
      responseBody - the response body content, may be null
      responseCharset - the response body charset, may be null
      Since:
      3.0.5
    • HttpStatusCodeException

      protected HttpStatusCodeException(HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders responseHeaders, @Nullable byte[] responseBody, @Nullable Charset responseCharset)
      Construct instance with an HttpStatusCode, status text, content, and a response charset.
      Parameters:
      statusCode - the status code
      statusText - the status text
      responseHeaders - the response headers, may be null
      responseBody - the response body content, may be null
      responseCharset - the response body charset, may be null
      Since:
      3.1.2
    • HttpStatusCodeException

      protected HttpStatusCodeException(String message, HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders responseHeaders, @Nullable byte[] responseBody, @Nullable Charset responseCharset)
      Construct instance with an HttpStatusCode, status text, content, and a response charset.
      Parameters:
      message - the exception message
      statusCode - the status code
      statusText - the status text
      responseHeaders - the response headers, may be null
      responseBody - the response body content, may be null
      responseCharset - the response body charset, may be null
      Since:
      5.2.2