From f7c698ec6681eabf3519cb02962fdc705b0f38f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 9 Dec 2023 06:01:38 +0100 Subject: [PATCH] Continued: - need to catch any network-related exceptions to reduce _DEPTH counter --- fba/http/federation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fba/http/federation.py b/fba/http/federation.py index 8b1508d..88a100e 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -107,8 +107,12 @@ def fetch_instances(domain: str, origin: str, software: str, command: str, path: peerlist = list() logger.debug("software='%s'", software) if software is not None: - logger.debug("Fetching instances for domain='%s',software='%s',origin='%s'", domain, software, origin) - peerlist = fetch_peers(domain, software, origin) + try: + logger.debug("Fetching instances for domain='%s',software='%s',origin='%s'", domain, software, origin) + peerlist = fetch_peers(domain, software, origin) + except network.exceptions as exception: + _DEPTH = _DEPTH - 1 + raise exception logger.debug("peerlist[]='%s'", type(peerlist)) if isinstance(peerlist, list): -- 2.39.5