Class JsonRpcException

  • All Implemented Interfaces:
    Serializable

    public class JsonRpcException
    extends Exception
    This exception is thrown when a JSON-RPC request results in a response with an error.
    See Also:
    Serialized Form
    • Constructor Detail

      • JsonRpcException

        public JsonRpcException​(String message,
                                int code)
        Constructs a new JSON-RPC exception.
        Parameters:
        message - the error message
        code - the error code
      • JsonRpcException

        public JsonRpcException​(String message,
                                int code,
                                Object data)
        Constructs a new JSON-RPC exception. The value of "data" can be converted to a JSON string.
        Parameters:
        message - the error message
        code - the error code
        data - additional data about the error or null
    • Method Detail

      • getCode

        public int getCode()
        Returns the error code.
        Returns:
        the error code
      • getData

        public Object getData()
        Returns additional data about the error. This may be null. The data can be converted to a JSON string.
        Returns:
        additional data about the error or null