Class SDKError

  • All Implemented Interfaces:
    java.io.Serializable

    public class SDKError
    extends StackOneError
    Thrown by a service call when an error response occurs. Contains details about the response.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SDKError​(java.lang.String message, int code, byte[] body, java.net.http.HttpResponse<java.io.InputStream> rawResponse, java.lang.Throwable cause)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static SDKError from​(java.lang.String message, java.net.http.HttpResponse<java.io.InputStream> rawResponse)  
      static SDKError from​(java.lang.String message, java.net.http.HttpResponse<java.io.InputStream> rawResponse, java.lang.Throwable cause)  
      java.net.http.HttpResponse<java.io.InputStream> rawResponse()
      Returns the raw HTTP response associated with this exception.
      • 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

      • SDKError

        public SDKError​(java.lang.String message,
                        int code,
                        @Nullable
                        byte[] body,
                        java.net.http.HttpResponse<java.io.InputStream> rawResponse,
                        @Nullable
                        java.lang.Throwable cause)
    • Method Detail

      • from

        public static SDKError from​(java.lang.String message,
                                    java.net.http.HttpResponse<java.io.InputStream> rawResponse)
      • from

        public static SDKError from​(java.lang.String message,
                                    java.net.http.HttpResponse<java.io.InputStream> rawResponse,
                                    @Nullable
                                    java.lang.Throwable cause)
      • rawResponse

        public java.net.http.HttpResponse<java.io.InputStream> rawResponse()
        Description copied from class: StackOneError
        Returns the raw HTTP response associated with this exception. The response body stream may not be available (but the body can be accessed via the body() method).
        Overrides:
        rawResponse in class StackOneError
        Returns:
        the raw HTTP response