]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
storage.py: improve some precondition() error messages
authorBrian Warner <warner@allmydata.com>
Fri, 10 Oct 2008 01:14:25 +0000 (18:14 -0700)
committerBrian Warner <warner@allmydata.com>
Fri, 10 Oct 2008 01:14:25 +0000 (18:14 -0700)
src/allmydata/storage.py

index 29b4019dd6b258c1b705fa99b1290a84ab672d7c..f86dc3bf08728a517ac62508dda409a8470ef985 100644 (file)
@@ -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)