From 44467de4f52160d3580d659ae3fb1b4646fc4696 Mon Sep 17 00:00:00 2001 From: Yosuke Otosu Date: Thu, 2 Feb 2023 14:37:29 +0900 Subject: [PATCH] feat: add HTTPError handling to web3_utils --- app/utils/web3_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/utils/web3_utils.py b/app/utils/web3_utils.py index f0b66628..3f541a56 100644 --- a/app/utils/web3_utils.py +++ b/app/utils/web3_utils.py @@ -31,7 +31,10 @@ RPCResponse ) from eth_typing import URI -from requests.exceptions import ConnectionError +from requests.exceptions import ( + ConnectionError, + HTTPError +) from config import ( WEB3_HTTP_PROVIDER, @@ -121,7 +124,7 @@ def make_request(self, method: RPCEndpoint, params: Any) -> RPCResponse: self.endpoint_uri = URI(_node.endpoint_uri) try: return super().make_request(method, params) - except (ConnectionError, JSONDecodeError): + except (ConnectionError, JSONDecodeError, HTTPError): # NOTE: # JSONDecodeError will be raised if a request is sent # while Quorum is terminating.