fix access to possibly unset var err
This commit is contained in:
parent
dfc9420a3f
commit
8f31add5a7
1 changed files with 5 additions and 4 deletions
|
|
@ -165,11 +165,12 @@ class Bot:
|
||||||
for h, t in tasks.items():
|
for h, t in tasks.items():
|
||||||
assert t.done()
|
assert t.done()
|
||||||
try:
|
try:
|
||||||
err = t.exception() # type: ignore
|
err = t.exception()
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
log.error("Message handler took too long to finished: %s", h)
|
log.error("Message handler took too long to finish: %s", h)
|
||||||
if err is not None:
|
else:
|
||||||
log.exception("Error in message handler: %s", h, exc_info=err)
|
if err is not None:
|
||||||
|
log.exception("Error in message handler: %s", h, exc_info=err)
|
||||||
|
|
||||||
async def _on_invite(self, room: MatrixRoom, event: InviteMemberEvent):
|
async def _on_invite(self, room: MatrixRoom, event: InviteMemberEvent):
|
||||||
if self.config.is_dev:
|
if self.config.is_dev:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue