For normal (synchronous) Traits observers, if an exception occurs then we execute Traits's exception handler, which by default simply logs the exception. The relevant code (or at least part of it) is here:
|
try: |
|
self.dispatcher(handler, event) |
|
except Exception: |
|
handle_exception(event) |
For asynchronous Traits observers as introduced by PR #1770, exceptions occurring in the observer are swallowed entirely, with no easy way to log the exception.
It would be useful to have the option to act on the exception in some way (for example, by logging). This would probably entail adding a Traits-specific wrapper around the coroutine to be executed.
For normal (synchronous) Traits observers, if an exception occurs then we execute Traits's exception handler, which by default simply logs the exception. The relevant code (or at least part of it) is here:
traits/traits/observation/_trait_event_notifier.py
Lines 121 to 124 in 53654f9
For asynchronous Traits observers as introduced by PR #1770, exceptions occurring in the observer are swallowed entirely, with no easy way to log the exception.
It would be useful to have the option to act on the exception in some way (for example, by logging). This would probably entail adding a Traits-specific wrapper around the coroutine to be executed.