summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/connection.py
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-03-26 20:43:33 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-03-26 20:43:33 +0000
commitb3ed4655ef3b9694c53325eb952f5affc45cdb51 (patch)
tree19dfb6f5fb455caea9e86f98ff80b38213bfca12 /rdiff-backup/rdiff_backup/connection.py
parentabbd3dde1b37b92be97c099edc1d31745b9b21ae (diff)
downloadrdiff-backup-b3ed4655ef3b9694c53325eb952f5affc45cdb51.tar.gz
Improved error reporting when rdiff-backup doesn't start correctly on
the remote side. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@27 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/connection.py')
-rw-r--r--rdiff-backup/rdiff_backup/connection.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/rdiff-backup/rdiff_backup/connection.py b/rdiff-backup/rdiff_backup/connection.py
index 4c87979..9842480 100644
--- a/rdiff-backup/rdiff_backup/connection.py
+++ b/rdiff-backup/rdiff_backup/connection.py
@@ -7,6 +7,7 @@ import types, os, tempfile, cPickle, shutil, traceback
#
class ConnectionError(Exception): pass
+class ConnectionReadError(ConnectionError): pass
class ConnectionQuit(Exception): pass
@@ -210,8 +211,9 @@ class LowLevelPipeConnection(Connection):
def _get(self):
"""Read an object from the pipe and return (req_num, value)"""
header_string = self.inpipe.read(9)
- assert len(header_string) == 9, \
- "Error reading from pipe (problem probably originated remotely)"
+ if not len(header_string) == 9:
+ raise ConnectionReadError("Truncated header string (problem "
+ "probably originated remotely)")
try:
format_string, req_num, length = (header_string[0],
ord(header_string[1]),