quick frontend(app): catch exception when trying to remove a missing listener, and log it

This commit is contained in:
Goffi 2019-11-18 22:34:13 +01:00
commit 4f4c4448ee

View file

@ -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