Class StackOneError

    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<byte[]> body()  
      java.util.Optional<java.lang.String> bodyAsString()  
      int code()  
      Headers headers()
      Returns the headers from the raw HTTP response as a map.
      java.lang.String message()  
      java.net.http.HttpResponse<?> rawResponse()
      Returns the raw HTTP response associated with this exception.
      java.lang.String toString()  
      StackOneError withBody​(byte[] body)  
      StackOneError withCode​(int code)  
      StackOneError withRawResponse​(java.net.http.HttpResponse<?> rawResponse)  
      • 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

      • StackOneError

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

      • body

        public java.util.Optional<byte[]> body()
      • bodyAsString

        public java.util.Optional<java.lang.String> bodyAsString()
      • code

        public int code()
      • rawResponse

        public java.net.http.HttpResponse<?> rawResponse()
        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).
        Returns:
        the raw HTTP response
      • headers

        public Headers headers()
        Returns the headers from the raw HTTP response as a map.
        Returns:
        response headers
      • message

        public java.lang.String message()
      • withBody

        public StackOneError withBody​(@Nullable
                                      byte[] body)
      • withRawResponse

        public StackOneError withRawResponse​(java.net.http.HttpResponse<?> rawResponse)
      • toString

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