Class JsonRpcApiException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MoeraNamingApiException, PushRelayApiException

public class JsonRpcApiException extends RuntimeException
Represents an exception thrown when a JSON-RPC API interaction encounters an error. This exception provides additional information about the error through an associated JSON-RPC error code.
See Also:
  • Constructor Details

    • JsonRpcApiException

      public JsonRpcApiException(int rpcCode, String message)
      Constructs a new JsonRpcApiException instance with a specified JSON-RPC error code and message.
      Parameters:
      rpcCode - the JSON-RPC error code associated with this exception
      message - the detail message providing additional information about the error
    • JsonRpcApiException

      public JsonRpcApiException(JsonRpcError jsonRpcError)
      Constructs a new JsonRpcApiException instance using the specified JsonRpcError.
      Parameters:
      jsonRpcError - the JSON-RPC error containing error code and message to associate with this exception
  • Method Details

    • getRpcCode

      public int getRpcCode()
      Retrieves the JSON-RPC error code associated with this exception.
      Returns:
      the JSON-RPC error code representing the specific error condition
    • getRpcError

      public JsonRpcError getRpcError()
      Constructs and returns a JsonRpcError object representing the JSON-RPC error associated with this exception. The returned error object will contain the error code and message of this exception.
      Returns:
      a JsonRpcError object containing the error code and message.