mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Fix local variable 'feeds_response' referenced before assignment, small improvement on DEBUG DUMP
This commit is contained in:
parent
e256d7cd15
commit
482b217c1f
|
@ -56,7 +56,11 @@ class DomainManager:
|
||||||
def result_handler(result: asyncio.Task):
|
def result_handler(result: asyncio.Task):
|
||||||
if result.cancelled():
|
if result.cancelled():
|
||||||
return "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:
|
if result is None:
|
||||||
return None
|
return None
|
||||||
if isinstance(result, Exception):
|
if isinstance(result, Exception):
|
||||||
|
|
|
@ -541,7 +541,7 @@ class Wiki:
|
||||||
feeds_response.raise_for_status()
|
feeds_response.raise_for_status()
|
||||||
except (aiohttp.ClientConnectionError, aiohttp.ServerTimeoutError, asyncio.TimeoutError,
|
except (aiohttp.ClientConnectionError, aiohttp.ServerTimeoutError, asyncio.TimeoutError,
|
||||||
aiohttp.ClientResponseError, aiohttp.TooManyRedirects) as e:
|
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)
|
raise WikiServerError(e)
|
||||||
return feeds_response, await feeds_response.json(encoding="UTF-8")
|
return feeds_response, await feeds_response.json(encoding="UTF-8")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue