From ba2c8fab6de69f73cb552cef0f01692e1f8796bb Mon Sep 17 00:00:00 2001 From: Phi Date: Wed, 19 Aug 2020 13:54:12 +0200 Subject: [PATCH] Exit remotinator with an explicit error message when terminator is need but not running. --- terminatorlib/ipc.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/terminatorlib/ipc.py b/terminatorlib/ipc.py index 861b792c..93395874 100644 --- a/terminatorlib/ipc.py +++ b/terminatorlib/ipc.py @@ -2,6 +2,7 @@ # GPL v2 only """ipc.py - DBus server and API calls""" +import sys import hashlib from gi.repository import Gdk import dbus.service @@ -194,7 +195,14 @@ def with_proxy(func): dbg('dbus client call: %s' % func.__name__) def _exec(*args, **argd): bus = dbus.SessionBus() - proxy = bus.get_object(BUS_NAME, BUS_PATH) + try: + proxy = bus.get_object(BUS_NAME, BUS_PATH) + + except dbus.DBusException as e: + sys.exit( + "Remotinator can't connect to terminator. " + + "May be terminator is not running.") + func(proxy, *args, **argd) return _exec