Skip to content

Commit 7262bc6

Browse files
committed
fix exception handling
1 parent 2213b1b commit 7262bc6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/monitoring_tests/buffers_monitoring_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def compute_buffers_value(self) -> bool:
4646
kleros_list = self.kleros_api.get_token_list()
4747

4848
value_in_usd = 0.0
49+
if "tokens" not in ethplorer_rsp:
50+
return False
4951
for token in ethplorer_rsp["tokens"]:
5052
if token["tokenInfo"]["address"] not in kleros_list:
5153
continue
@@ -77,9 +79,9 @@ def compute_buffers_value(self) -> bool:
7779
else:
7880
self.logger.info(log_output)
7981

80-
except Exception as err:
82+
except requests.RequestException as err:
8183
self.logger.warning(
82-
f"Error while fetching buffer tokens and prices, error: {err}"
84+
f"Connection Error while fetching buffer tokens and prices, error: {err}"
8385
)
8486
return False
8587
return True

0 commit comments

Comments
 (0)