Skip to content

Commit

Permalink
catch BaseException to AsyncEvent._trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
aleneum committed May 3, 2024
1 parent 07c9cd3 commit 93f0f9d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions transitions/extensions/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,14 @@ async def _trigger(self, event_data):
else:
raise
finally:
await self.machine.callbacks(self.machine.finalize_event, event_data)
_LOGGER.debug("%sExecuted machine finalize callbacks", self.machine.name)
try:
await self.machine.callbacks(self.machine.finalize_event, event_data)
_LOGGER.debug("%sExecuted machine finalize callbacks", self.machine.name)
except BaseException as err: # pylint: disable=broad-except; Exception will be handled elsewhere
_LOGGER.error("%sWhile executing finalize callbacks a %s occurred: %s.",
self.machine.name,
type(err).__name__,
str(err))
return event_data.result

async def _process(self, event_data):
Expand Down

0 comments on commit 93f0f9d

Please sign in to comment.