Closed smartcontracts closed 6 years ago
Errors are not handled in ChildChainService. An invalid request will simply result in the following KeyError:
ChildChainService
KeyError
KeyError: 'result'
This error occurs because ChildChainService expects each response to have a 'result' field:
def send_request(self, method, args): payload = { "method": method, "params": args, "jsonrpc": "2.0", "id": 0, } response = requests.post(self.url, json=payload).json() return response["result"]
We should handle this gracefully, perhaps by passing the error back through the server and into the child chain service.
Errors are not handled in
ChildChainService
. An invalid request will simply result in the followingKeyError
:This error occurs because
ChildChainService
expects each response to have a 'result' field:We should handle this gracefully, perhaps by passing the error back through the server and into the child chain service.