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.
This commit is contained in:
Peter Hutterer 2018-02-02 09:56:24 +10:00
parent ddef5ea38a
commit b305d6e287
1 changed files with 7 additions and 1 deletions

View File

@ -302,7 +302,13 @@ class TuhiKeteManager(_DBusObject):
self.proxy.StartSearch() self.proxy.StartSearch()
def stop_search(self): def stop_search(self):
try:
self.proxy.StopSearch() 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 = {} self._pairable_devices = {}
def terminate(self): def terminate(self):