From 17403847633eab53e49ba99d0a45808a4621c3be Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 31 Oct 2015 22:41:08 +0100 Subject: [PATCH] prettier connection closed message, fixes #307 --- borg/remote.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/borg/remote.py b/borg/remote.py index 5d8c71a88..ff8144824 100644 --- a/borg/remote.py +++ b/borg/remote.py @@ -23,6 +23,10 @@ class ConnectionClosed(Error): """Connection closed by remote host""" +class ConnectionClosedWithHint(ConnectionClosed): + """Connection closed by remote host. {}""" + + class PathNotAllowed(Error): """Repository path not allowed""" @@ -148,7 +152,7 @@ class RemoteRepository: try: version = self.call('negotiate', 1) except ConnectionClosed: - raise Exception('Server immediately closed connection - is Borg installed and working on the server?') + raise ConnectionClosedWithHint('Is borg working on the server?') if version != 1: raise Exception('Server insisted on using unsupported protocol version %d' % version) self.id = self.call('open', location.path, create)