Fix local variable 'feeds_response' referenced before assignment, small improvement on DEBUG DUMP

This commit is contained in:
Frisk 2024-09-19 14:36:02 +02:00
parent e256d7cd15
commit 482b217c1f
2 changed files with 6 additions and 2 deletions

View file

@ -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):

View file

@ -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")