From b305d6e287c2d609c0dad1c40eb0ef621fe80621 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 2 Feb 2018 09:56:24 +1000 Subject: [PATCH] kete: ignore dbus errors during StopSearch we may call StopSearch after the daemon vanished and while we're stopping all the workers. Ignore the ServiceUnknown error here. --- tools/tuhi-kete.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/tuhi-kete.py b/tools/tuhi-kete.py index d1477e3..5a92c30 100755 --- a/tools/tuhi-kete.py +++ b/tools/tuhi-kete.py @@ -302,7 +302,13 @@ class TuhiKeteManager(_DBusObject): self.proxy.StartSearch() def stop_search(self): - self.proxy.StopSearch() + try: + self.proxy.StopSearch() + except GLib.Error as e: + if (e.domain != 'g-dbus-error-quark' or + e.code != Gio.IOErrorEnum.EXISTS or + Gio.dbus_error_get_remote_error(e) != 'org.freedesktop.DBus.Error.ServiceUnknown'): + raise e self._pairable_devices = {} def terminate(self):