Class HttpResponseException

  • All Implemented Interfaces:
    java.io.Serializable

    public class HttpResponseException
    extends java.io.IOException
    An IO exception for HTTP response exceptions. Normalization between client library exceptions, or lack thereof.
    Since:
    2.6
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpResponseException​(java.net.URL url, int statusCode, java.lang.String statusMessage, java.lang.String content, java.io.IOException cause)
      Creates a HttpClientConnectException based on original ConnectException.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContent()  
      int getStatusCode()  
      java.lang.String getStatusMessage()  
      java.net.URL getUrl()  
      • 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

      • HttpResponseException

        public HttpResponseException​(@Nonnull
                                     java.net.URL url,
                                     int statusCode,
                                     @Nonnull
                                     java.lang.String statusMessage,
                                     @Nullable
                                     java.lang.String content,
                                     @Nullable
                                     java.io.IOException cause)
        Creates a HttpClientConnectException based on original ConnectException.
        Parameters:
        url - The URL tried to connect to.
        statusCode - The response code.
        statusMessage - The response status message.
        content - The response body, if any.
        cause - The cause of the exception, if any.
    • Method Detail

      • getUrl

        @Nonnull
        public java.net.URL getUrl()
      • getStatusCode

        public int getStatusCode()
      • getStatusMessage

        @Nonnull
        public java.lang.String getStatusMessage()
      • getContent

        @Nullable
        public java.lang.String getContent()