From: Brian Warner Date: Sun, 8 Jan 2012 02:05:08 +0000 (-0800) Subject: mutable/layout.py: raise BadShareError instead of assert() X-Git-Url: https://git.rkrishnan.org/Site/Content/Exhibitors/module-simplejson.tests.html?a=commitdiff_plain;h=c56839478ef395f6b2bcaedee1fe2aeae0d75903;p=tahoe-lafs%2Ftahoe-lafs.git mutable/layout.py: raise BadShareError instead of assert() --- diff --git a/src/allmydata/mutable/common.py b/src/allmydata/mutable/common.py index 4a04339f..9ce11c53 100644 --- a/src/allmydata/mutable/common.py +++ b/src/allmydata/mutable/common.py @@ -10,7 +10,13 @@ MODE_READ = "MODE_READ" class NotWriteableError(Exception): pass -class NeedMoreDataError(Exception): +class BadShareError(Exception): + """This represents an error discovered in a particular share, during + retrieve, from which we can recover by using some other share. This does + *not* include local coding errors. + """ + +class NeedMoreDataError(BadShareError): def __init__(self, needed_bytes, encprivkey_offset, encprivkey_length): Exception.__init__(self) self.needed_bytes = needed_bytes # up through EOF @@ -40,7 +46,7 @@ class NotEnoughServersError(Exception): Exception.__init__(self, why, first_error) self.first_error = first_error -class CorruptShareError(Exception): +class CorruptShareError(BadShareError): def __init__(self, server, shnum, reason): self.args = (server, shnum, reason) self.server = server @@ -50,7 +56,7 @@ class CorruptShareError(Exception): return "