mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 01:06:50 +00:00
prettier connection closed message, fixes #307
This commit is contained in:
parent
3c2dee6eb6
commit
1740384763
1 changed files with 5 additions and 1 deletions
|
@ -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 @@ def __init__(self, location, create=False):
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue