Sfoglia il codice sorgente

better Exception msg if there is no Borg installed on the remote repository server

(still a bit ugly to get even 2 tracebacks)
Thomas Waldmann 10 anni fa
parent
commit
2743ab1593
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      borg/remote.py

+ 4 - 1
borg/remote.py

@@ -141,7 +141,10 @@ class RemoteRepository:
         self.r_fds = [self.stdout_fd]
         self.r_fds = [self.stdout_fd]
         self.x_fds = [self.stdin_fd, self.stdout_fd]
         self.x_fds = [self.stdin_fd, self.stdout_fd]
 
 
-        version = self.call('negotiate', 1)
+        try:
+            version = self.call('negotiate', 1)
+        except ConnectionClosed:
+            raise Exception('Server immediately closed connection - is Borg installed and working on the server?')
         if version != 1:
         if version != 1:
             raise Exception('Server insisted on using unsupported protocol version %d' % version)
             raise Exception('Server insisted on using unsupported protocol version %d' % version)
         self.id = self.call('open', location.path, create)
         self.id = self.call('open', location.path, create)