Class B2Exception

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_CODE  
    • Constructor Summary

      Constructors 
      Constructor Description
      B2Exception​(java.lang.String code, int status, java.lang.Integer retryAfterSecondsOrNull, java.lang.String message)  
      B2Exception​(java.lang.String code, int status, java.lang.Integer retryAfterSecondsOrNull, java.lang.String message, java.lang.Throwable cause)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static B2Exception create​(java.lang.String code, int status, java.lang.Integer retryAfterSecondsOrNull, java.lang.String message)
      Returns a new B2Exception, trying to provide the appropriate subclass to characterize the it.
      java.lang.String getCode()  
      java.lang.Integer getRetryAfterSecondsOrNull()  
      int getStatus()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Throwable

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

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

      • B2Exception

        public B2Exception​(java.lang.String code,
                           int status,
                           java.lang.Integer retryAfterSecondsOrNull,
                           java.lang.String message)
      • B2Exception

        public B2Exception​(java.lang.String code,
                           int status,
                           java.lang.Integer retryAfterSecondsOrNull,
                           java.lang.String message,
                           java.lang.Throwable cause)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Throwable
      • getCode

        public java.lang.String getCode()
      • getStatus

        public int getStatus()
      • getRetryAfterSecondsOrNull

        public java.lang.Integer getRetryAfterSecondsOrNull()
      • create

        public static B2Exception create​(java.lang.String code,
                                         int status,
                                         java.lang.Integer retryAfterSecondsOrNull,
                                         java.lang.String message)
        Returns a new B2Exception, trying to provide the appropriate subclass to characterize the it.
        Parameters:
        code - the code from the error response
        status - the http status from the response.
        retryAfterSecondsOrNull - the value of 'Retry-After' header if it's an integer number of seconds.
        message - the message in the error response.
        Returns:
        a new B2Exception (maybe an instance of one of its subclasses)