From 482b217c1fa0141bd98f01d25cfc78b8db583521 Mon Sep 17 00:00:00 2001 From: Frisk Date: Thu, 19 Sep 2024 14:36:02 +0200 Subject: [PATCH] Fix local variable 'feeds_response' referenced before assignment, small improvement on DEBUG DUMP --- src/domain_manager.py | 6 +++++- src/wiki.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/domain_manager.py b/src/domain_manager.py index 63c9dcf..9d4dbb6 100644 --- a/src/domain_manager.py +++ b/src/domain_manager.py @@ -56,7 +56,11 @@ class DomainManager: def result_handler(result: asyncio.Task): if result.cancelled(): return "cancelled" - result = result.result() + try: + result = result.result() + except Exception as e: + logger.exception("Re-raised exception from task on debug for task") + result = e if result is None: return None if isinstance(result, Exception): diff --git a/src/wiki.py b/src/wiki.py index 67bbdb5..926eaa3 100644 --- a/src/wiki.py +++ b/src/wiki.py @@ -541,7 +541,7 @@ class Wiki: feeds_response.raise_for_status() except (aiohttp.ClientConnectionError, aiohttp.ServerTimeoutError, asyncio.TimeoutError, aiohttp.ClientResponseError, aiohttp.TooManyRedirects) as e: - logger.error("A connection error occurred while requesting {}".format(feeds_response.url)) + logger.error("A connection error occurred while requesting {} with params {}".format(url_path, params)) raise WikiServerError(e) return feeds_response, await feeds_response.json(encoding="UTF-8")