Skip to content

Commit

Permalink
fix: key error with error code
Browse files Browse the repository at this point in the history
  • Loading branch information
GitBolt committed Jan 15, 2024
1 parent 51a2554 commit a76d3c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion solathon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit a76d3c6

Please sign in to comment.