You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when observer raises an exception and there is no error_event, logging fails
def__call__(self, caller, *args, **kwargs):
"""Loop over all active callbacks and call them"""forslotinself.slots.copy():
ref=slot.weakreffunc=slot.functry:
ifref:
obj=ref()
else:
obj=slot.objresult=NoneifobjisNone:
iffunc:
result=func(*args, **kwargs)
else:
iffunc:
result=func(obj, *args, **kwargs)
else:
result=obj(*args, **kwargs)
# even though asyncio.iscoroutine() would also work here,# this manual hasattr() check performs better.ifresultandhasattr(result, "__await__"):
asyncio.ensure_future(result, loop=get_event_loop())
exceptExceptionaserror:
# It's not really clear in the documentation or usage that exceptions# get returned via an 'error_event' callback. We should make sure# people know this clearly so event handler callback errors are noticed.iflen(caller.error_event):
caller.error_event.emit(caller, error)
else:
>Event.logger.exception(
f"Value {args} caused exception for event {caller}"
)
EAttributeError: typeobject'Event'hasnoattribute'logger'eventkit/event.py:112: AttributeError
The text was updated successfully, but these errors were encountered:
when observer raises an exception and there is no
error_event
, logging failsThe text was updated successfully, but these errors were encountered: