further fix to logging a failure

This commit is contained in:
Frisk 2025-02-15 09:27:04 +01:00
parent 3d6a2c5ac0
commit c8080e60b3

View file

@ -486,7 +486,7 @@ class Wiki:
request = await self.fetch_wiki(amount=amount)
self.client.last_request = request
except (aiohttp.ServerTimeoutError, asyncio.TimeoutError, WikiServerError, ServerError) as e:
self.statistics.update(Log(type=LogType.CONNECTION_ERROR, title=str(e.exception)))
self.statistics.update(Log(type=LogType.CONNECTION_ERROR, title=str(str(e.exception) if hasattr(e, "exception") else repr(e))))
amount_of_failures = len(self.statistics.last_connection_failures()[0])
if amount_of_failures < 2:
await asyncio.sleep(5.0)