When an error/exception (such as a NameError because I typo'd a variable name) occurs in notification_filter
-- the error/exception information doesn't appear to be propagated (or is caught silently).
A simple example:
import dbus
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
def notification_filter(bus, message):
raise Exception("This exception is never propagated/printed")
if __name__ == "__main__":
DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus.add_match_string_non_blocking("eavesdrop=true, interface='org.freedesktop.Notifications', member='Notify'")
bus.add_message_filter(notification_filter)
mainloop = GLib.MainLoop()
mainloop.run()
How can I print/log information when an error/exception occurs?