diff --git a/bal/core/willexecutors.py b/bal/core/willexecutors.py index 37ca254..e1468b8 100644 --- a/bal/core/willexecutors.py +++ b/bal/core/willexecutors.py @@ -73,6 +73,10 @@ chainname = BalPlugin.chainname class Willexecutors: + class NoServersForChainError(Exception): + """Raised when the welist server responds but returns no data for the + requested chain, indicating no active servers for that network.""" + # Expose the networking constants as class attributes so the GUI layer can # reference them (e.g. to show the "Xs / DEADLINEs" countdown) without # importing module-level names. Single source of truth: the module diff --git a/bal/gui/qt/window.py b/bal/gui/qt/window.py index 020a69e..3cedf62 100644 --- a/bal/gui/qt/window.py +++ b/bal/gui/qt/window.py @@ -1112,6 +1112,7 @@ class BalWindow: candidates.append(url) result = {} + any_server_reached = False net = Network.get_instance() _logger.info(f"fetch_will_executors_list: network present = {net is not None}") for url in candidates: @@ -1124,6 +1125,7 @@ class BalWindow: resp = Willexecutors.send_request( "get", url, timeout=10, max_retries=1, retry_sleep=1, ) + any_server_reached = True _logger.info( f"fetch_will_executors_list: resp type={type(resp).__name__} " f"len={len(resp) if hasattr(resp, '__len__') else 'n/a'}" @@ -1142,6 +1144,8 @@ class BalWindow: _logger.error( f"fetch_will_executors_list: {url} -> {type(e).__name__}: {e}" ) + if not result and any_server_reached: + raise Willexecutors.NoServersForChainError(chainname) return result # Simple, user-facing message shown when the download fails for any reason @@ -1205,7 +1209,14 @@ class BalWindow: def on_failure(exc_info): _logger.error(f"download_list failed: {exc_info}") - self.show_warning(_(self.DOWNLOAD_FAILED_MESSAGE)) + if isinstance(exc_info[1], Willexecutors.NoServersForChainError): + chainname = BalPlugin.chainname + self.show_warning(_( + f"No active will-executor found for the " + f"{chainname} network." + )) + else: + self.show_warning(_(self.DOWNLOAD_FAILED_MESSAGE)) self.waiting_dialog = BalWaitingDialog( self, base_msg, task, on_success, on_failure, exe=False