Package 

Class HttpException

  • All Implemented Interfaces:
    java.io.Serializable

    
    public final class HttpException
    extends IOException
                        

    Thrown when an http request fails.

    Exposes the specific status code or UNKNOWN via getStatusCode so users may attempt to retry or otherwise uniformly handle certain types of errors regardless of the underlying http library.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static int UNKNOWN
      private final int statusCode
    • Method Summary

      Modifier and Type Method Description
      int getStatusCode() Returns the http status code, or UNKNOWN if the request failed without providing astatus code.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpException

        HttpException(int statusCode)
      • HttpException

        HttpException(String message)
      • HttpException

        HttpException(String message, int statusCode)
      • HttpException

        HttpException(String message, int statusCode, Throwable cause)
    • Method Detail

      • getStatusCode

         int getStatusCode()

        Returns the http status code, or UNKNOWN if the request failed without providing astatus code.