Mercurial > libervia-backend
diff sat_frontends/quick_frontend/quick_app.py @ 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 | f8e3789912d0 |
children | ab7e8ade848a |
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