From 869fd4f7520c30a909830cecceb8553c4df6698c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 13 Oct 2014 07:11:45 +0200 Subject: [PATCH] Add an IPCError exception. --- qutebrowser/utils/ipc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/qutebrowser/utils/ipc.py b/qutebrowser/utils/ipc.py index 045b51db8..4966daf92 100644 --- a/qutebrowser/utils/ipc.py +++ b/qutebrowser/utils/ipc.py @@ -33,6 +33,11 @@ CONNECT_TIMEOUT = 100 server = None +class IPCError(Exception): + + """Exception raised when there was a problem with IPC.""" + + def send_to_running_instance(cmdlist): """Try to send a commandline to a running instance. @@ -61,12 +66,10 @@ def init_server(): server = QLocalServer() ok = QLocalServer.removeServer(SOCKETNAME) if not ok: - # FIXME - raise Exception + raise IPCError("Error while removing server {}!".format(SOCKETNAME)) ok = server.listen(SOCKETNAME) if not ok: - # FIXME - raise Exception("Error while listening to local socket: {}".format( + raise IPCError("Error while listening to local socket: {}".format( server.errorString())) server.newConnection.connect(on_localsocket_connection)