changeset 3077:ab8be8f1c92d

quick frontend(app): catch exception when trying to remove a missing listener, and log it
author Goffi <goffi@goffi.org>
date Mon, 18 Nov 2019 22:34:13 +0100
parents 2180b0f5c1cd
children 95c94d94872d
files sat_frontends/quick_frontend/quick_app.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/quick_app.py	Mon Nov 18 20:51:25 2019 +0100
+++ b/sat_frontends/quick_frontend/quick_app.py	Mon Nov 18 22:34:13 2019 +0100
@@ -565,7 +565,11 @@
         @param callback: callback to remove
         """
         assert type_ in C.LISTENERS
-        self._listeners[type_].pop(callback)
+        try:
+            self._listeners[type_].pop(callback)
+        except KeyError:
+            log.error(
+                f"Trying to remove an inexisting listener (type = {type_}): {callback}")
 
     def callListeners(self, type_, *args, **kwargs):
         """Call the methods which listen type_ event. If a profiles filter has