From 4ae10b669819fb665748de796515218dcdb47d47 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Wed, 30 Jun 2021 00:11:12 +0200 Subject: test_client.py: Catch D-Bus exception on startup --- test_client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test_client.py b/test_client.py index ee49bae..72538c1 100755 --- a/test_client.py +++ b/test_client.py @@ -29,8 +29,12 @@ import click import dbus -bus = dbus.SessionBus() -req = bus.get_object("org.ArcticaProject.RWASupportSessionService", "/RWASupportSessionService") +try: + bus = dbus.SessionBus() + req = bus.get_object("org.ArcticaProject.RWASupportSessionService", "/RWASupportSessionService") +except dbus.exceptions.DBusException: + click.echo("The D-Bus service isn't responding! Is it even started? Aborting ...") + exit(1) @click.group() -- cgit v1.2.3