Class SmartcarException

  • All Implemented Interfaces:
    java.io.Serializable

    public class SmartcarException
    extends java.lang.Exception
    Thrown when the Smartcar API library encounters a problem.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static SmartcarException Factory​(int statusCode, com.google.gson.JsonObject headers, com.google.gson.JsonObject body)  
      static SmartcarException Factory​(int statusCode, okhttp3.Headers headers, okhttp3.ResponseBody body)  
      java.lang.String getCode()  
      java.lang.String getDescription()
      Returns the description associated with the exception.
      com.google.gson.JsonArray getDetail()
      Returns the error details if available for this exception.
      java.lang.String getDocURL()
      Returns the documentation URL associated with the exception.
      java.lang.String getMessage()
      Returns the error message
      java.lang.String getRequestId()  
      java.lang.String getResolutionType()
      Returns the resolution type associated with the exception.
      java.lang.String getResolutionUrl()
      Returns a url associated with the resolution to the exception
      int getRetryAfter()
      Returns the retry-after unix timestamp (ms) upon hitting a rate limit error.
      int getStatusCode()  
      java.lang.String getSuggestedUserMessage()
      Returns the suggested user message if available for this exception.
      java.lang.String getType()
      Returns the error type associated with the SmartcarExceptionV2.
      • 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

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

      • Factory

        public static SmartcarException Factory​(int statusCode,
                                                com.google.gson.JsonObject headers,
                                                com.google.gson.JsonObject body)
      • Factory

        public static SmartcarException Factory​(int statusCode,
                                                okhttp3.Headers headers,
                                                okhttp3.ResponseBody body)
      • getMessage

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

        public int getStatusCode()
      • getRequestId

        public java.lang.String getRequestId()
      • getType

        public java.lang.String getType()
        Returns the error type associated with the SmartcarExceptionV2.
        Returns:
        the error type
      • getCode

        public java.lang.String getCode()
      • getDescription

        public java.lang.String getDescription()
        Returns the description associated with the exception.
        Returns:
        the description
      • getResolutionType

        public java.lang.String getResolutionType()
        Returns the resolution type associated with the exception.
        Returns:
        the resolution type
      • getResolutionUrl

        public java.lang.String getResolutionUrl()
        Returns a url associated with the resolution to the exception
        Returns:
        the resolution url
      • getDocURL

        public java.lang.String getDocURL()
        Returns the documentation URL associated with the exception.
        Returns:
        the documentation URL
      • getDetail

        public com.google.gson.JsonArray getDetail()
        Returns the error details if available for this exception.
        Returns:
        the error details
      • getSuggestedUserMessage

        public java.lang.String getSuggestedUserMessage()
        Returns the suggested user message if available for this exception.
        Returns:
        the suggested user message
      • getRetryAfter

        public int getRetryAfter()
        Returns the retry-after unix timestamp (ms) upon hitting a rate limit error.
        Returns:
        retry-after unix timestamp (ms)