forked from goodboy/tractor
1
0
Fork 0

Log cancels with appropriate level

sigintsaviour_citesthackin
Tyler Goodlet 2022-03-04 08:55:24 -05:00
parent 4be13b7387
commit 0062c96a3c
1 changed files with 6 additions and 1 deletions

View File

@ -271,7 +271,12 @@ def _run_asyncio_task(
task.exception() task.exception()
except BaseException as terr: except BaseException as terr:
task_err = terr task_err = terr
if isinstance(terr, CancelledError):
log.cancel(f'`asyncio` task cancelled: {task.get_name()}')
else:
log.exception(f'`asyncio` task: {task.get_name()} errored') log.exception(f'`asyncio` task: {task.get_name()} errored')
assert type(terr) is type(aio_err), 'Asyncio task error mismatch?' assert type(terr) is type(aio_err), 'Asyncio task error mismatch?'
if aio_err is not None: if aio_err is not None: