From 6c6d593e6dc4927a5b4af1e4d769a6885ca922a6 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 16 Oct 2018 14:53:37 +0100 Subject: [PATCH] Only log exceptions when they're not unsafe --- src/EventManager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/EventManager.py b/src/EventManager.py index dbcf7449..15115ad8 100644 --- a/src/EventManager.py +++ b/src/EventManager.py @@ -226,9 +226,10 @@ class EventHook(object): try: returns.append(hook.call(event)) except Exception as e: - self.log.error("failed to call event \"%s\"", - [self._get_path()], exc_info=True) - if not safe: + if safe: + self.log.error("failed to call event \"%s\"", + [self._get_path()], exc_info=True) + else: raise total_milliseconds = (time.monotonic() - start) * 1000