Fix logging of functools.partial() callbacks

This commit is contained in:
Lonami Exo 2018-07-21 17:52:42 +02:00
parent 3d7bff64c2
commit 46b2d910d7

View File

@ -283,16 +283,15 @@ class UpdateMethods(UserMethods):
try:
await callback(event)
except events.StopPropagation:
name = getattr(callback, '__name__', repr(callback))
__log__.debug(
"Event handler '{}' stopped chain of "
"propagation for event {}."
.format(callback.__name__,
type(event).__name__)
'Event handler "%s" stopped chain of propagation '
'for event %s.', name, type(event).__name__
)
break
except Exception:
__log__.exception('Unhandled exception on {}'
.format(callback.__name__))
name = getattr(callback, '__name__', repr(callback))
__log__.exception('Unhandled exception on %s', name)
async def _handle_auto_reconnect(self):
# Upon reconnection, we want to send getState