Class RpcException


public class RpcException extends IOException
A failure the remote end reported: an HTTP status outside 2xx, or a JSON-RPC error object. getCode() is the HTTP status for the first and the JSON-RPC error code for the second; isHttp() says which.
  • Constructor Details

    • RpcException

      public RpcException(int code, String message, Object data, boolean http)
      An error with a code, a message and the optional error data.
  • Method Details

    • http

      public static RpcException http(int status, String body)
      An HTTP failure.
    • getCode

      public int getCode()
      The HTTP status or the JSON-RPC error code.
    • isHttp

      public boolean isHttp()
      Whether the code is an HTTP status.
    • getData

      public Object getData()
      The JSON-RPC error's data member, or the HTTP body.