From a76d3c6f58486bc977ae6e48b7a39f70c2f11d38 Mon Sep 17 00:00:00 2001 From: GitBolt Date: Mon, 15 Jan 2024 18:48:43 +0530 Subject: [PATCH] fix: key error with error code --- solathon/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solathon/client.py b/solathon/client.py index 7a01dd6..d94d5a2 100644 --- a/solathon/client.py +++ b/solathon/client.py @@ -584,7 +584,7 @@ def build_and_send_request(self, method, params: List[Any]) -> RPCResponse | dic res: RPCResponse = self.http.send(data) if self.clean_response: if "error" in res: - raise RPCRequestError(f"Failed to fetch data from RPC endpoint. Error {res['error']['status_code']}: {res['error']['message']}") + raise RPCRequestError(f"Failed to fetch data from RPC endpoint. Error {res['error']['code']}: {res['error']['message']}") if isinstance(res['result'], dict) or isinstance(res['result'], list) or isinstance(res['result'], str) or res['result'] == None: return res['result']