Class ServiceResponseException

    • Constructor Summary

      Constructors 
      Constructor Description
      ServiceResponseException​(int statusCode, okhttp3.Response response)
      Instantiates a new Service Response Exception for a response that resulted in a bad status code.
      ServiceResponseException​(int statusCode, okhttp3.Response response, java.lang.String message, java.lang.Throwable cause)
      Instantiates a new Service Response Exception when we have a specific exception to wrap.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> getDebuggingInfo()
      Gets the response information other than the error message.
      Headers getHeaders()
      Gets the headers.
      java.lang.String getMessage()
      Gets the error message.
      java.lang.String getResponseBody()
      Gets the error response body as a string.
      int getStatusCode()
      Gets the HTTP status code.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, 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

      • ServiceResponseException

        public ServiceResponseException​(int statusCode,
                                        okhttp3.Response response)
        Instantiates a new Service Response Exception for a response that resulted in a bad status code.
        Parameters:
        statusCode - the status code
        response - the HTTP response
      • ServiceResponseException

        public ServiceResponseException​(int statusCode,
                                        okhttp3.Response response,
                                        java.lang.String message,
                                        java.lang.Throwable cause)
        Instantiates a new Service Response Exception when we have a specific exception to wrap.
        Parameters:
        statusCode - the status code
        response - the HTTP response
        message - a message to include in this exception
        cause - the specific exception to wrap inside this exception
    • Method Detail

      • getStatusCode

        public int getStatusCode()
        Gets the HTTP status code.
        Returns:
        the http status code
      • getMessage

        public java.lang.String getMessage()
        Gets the error message.
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        the error message
      • getHeaders

        public Headers getHeaders()
        Gets the headers.
        Returns:
        the headers
      • getDebuggingInfo

        public java.util.Map<java.lang.String,​java.lang.Object> getDebuggingInfo()
        Gets the response information other than the error message.
        Returns:
        the response information other than the error message
      • getResponseBody

        public java.lang.String getResponseBody()
        Gets the error response body as a string.
        Returns:
        the response body as a string