Error handling in json-rpc client