Class JsonRpcException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JsonRpcErrorException, JsonRpcStatusException

public class JsonRpcException extends IOException
JSON RPC Exception

The JsonRpcErrorException subclass includes a JsonRpcError object which can be used in server implementations to pass error information to the server's response serialization layer which can include the JsonRpcError in the JsonRpcResponse and in client implementations it can be used for a client to find the JsonRpcError that was returned.

The JsonRpcStatusException subclass contains support for HTTP response code and message.

TODO: Rethink the differences between the two subclasses in light of Bitcoin (and possibly other) implementations returning HTTP status codes along with JsonRpcError responses. Bitcoin even incorrectly returns a 500 for invalid parameters. I think I originally assumed that there would be either an HTTP status error or a JSON-RPC error, but in reality responses can probably have neither, either, or both.

See Also: