From 4f4c4448ee405ca8fd389ee5b1b40161c2f0d314 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 18 Nov 2019 22:34:13 +0100 Subject: [PATCH] quick frontend(app): catch exception when trying to remove a missing listener, and log it --- sat_frontends/quick_frontend/quick_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sat_frontends/quick_frontend/quick_app.py b/sat_frontends/quick_frontend/quick_app.py index 8b66b7a2..3c6df620 100644 --- a/sat_frontends/quick_frontend/quick_app.py +++ b/sat_frontends/quick_frontend/quick_app.py @@ -565,7 +565,11 @@ class QuickApp(object): @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