From: Brian Warner Date: Fri, 10 Oct 2008 01:14:25 +0000 (-0700) Subject: storage.py: improve some precondition() error messages X-Git-Url: https://git.rkrishnan.org/simplejson/%22news.html/install.html?a=commitdiff_plain;h=c289a9c31bb3364865fe76673ca2f274af972301;p=tahoe-lafs%2Ftahoe-lafs.git storage.py: improve some precondition() error messages --- diff --git a/src/allmydata/storage.py b/src/allmydata/storage.py index 29b4019d..f86dc3bf 100644 --- a/src/allmydata/storage.py +++ b/src/allmydata/storage.py @@ -118,8 +118,8 @@ class ShareFile: def write_share_data(self, offset, data): length = len(data) - precondition(offset >= 0) - precondition(offset+length <= self._size) + precondition(offset >= 0, offset) + precondition(offset+length <= self._size, offset+length, self._size) f = open(self.home, 'rb+') real_offset = self._data_offset+offset f.seek(real_offset)