From: Daira Hopwood Date: Thu, 5 Sep 2013 18:03:02 +0000 (+0100) Subject: Sun Jan 8 22:12:47 GMT 2012 Brian Warner X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/flags/(%5B%5E?a=commitdiff_plain;h=a1665a1ef43ed7aa92129e300208634d4d53f0af;p=tahoe-lafs%2Ftahoe-lafs.git Sun Jan 8 22:12:47 GMT 2012 Brian Warner * mutable/layout.py: raise BadShareError instead of assert() --- diff --git a/src/allmydata/mutable/common.py b/src/allmydata/mutable/common.py index c8960c0e..9ce8e37c 100644 --- a/src/allmydata/mutable/common.py +++ b/src/allmydata/mutable/common.py @@ -11,7 +11,13 @@ MODE_REPAIR = "MODE_REPAIR" # query all peers, get the privkey 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 @@ -41,7 +47,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 @@ -51,7 +57,7 @@ class CorruptShareError(Exception): return "