Handling errors from JSON RPC