Only log exceptions when they're not unsafe

This commit is contained in:
jesopo 2018-10-16 14:53:37 +01:00
parent 42a1cda92c
commit 6c6d593e6d

View file

@ -226,9 +226,10 @@ class EventHook(object):
try: try:
returns.append(hook.call(event)) returns.append(hook.call(event))
except Exception as e: except Exception as e:
if safe:
self.log.error("failed to call event \"%s\"", self.log.error("failed to call event \"%s\"",
[self._get_path()], exc_info=True) [self._get_path()], exc_info=True)
if not safe: else:
raise raise
total_milliseconds = (time.monotonic() - start) * 1000 total_milliseconds = (time.monotonic() - start) * 1000