mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools: ratbagd: throw an error if the system bus is unavailable
When running in a container (CircleCI), dbus may not be available. Throw one of our errors to be consistent with our behavior when the name owner isn't available. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Benjamin Tissoires
parent
0e26b6e2be
commit
98fa9c168a
@@ -111,7 +111,11 @@ class _RatbagdDBus(GObject.GObject):
|
||||
GObject.GObject.__init__(self)
|
||||
|
||||
if _RatbagdDBus._dbus is None:
|
||||
_RatbagdDBus._dbus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
|
||||
try:
|
||||
_RatbagdDBus._dbus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
|
||||
except GLib.Error:
|
||||
raise RatbagdDBusUnavailable()
|
||||
|
||||
if _RatbagdDBus._dbus is None:
|
||||
raise RatbagdDBusUnavailable()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user