immutable: do not catch arbitrary exceptions/failures from the attempt to get a crypttext hash tree -- catch only ServerFailure, IntegrityCheckReject, LayoutInvalid, ShareVersionIncompatible, and DeadReferenceError

Once again I inserted a bug into the code, and once again it was hidden by something catching arbitrary exception/failure and assuming that it means the server failed to provide valid data.
This commit is contained in:
Zooko O'Whielacronx 2009-01-07 22:25:51 -07:00
parent e598ca2f3f
commit 6011f4522f

View File

@ -124,9 +124,14 @@ class ValidatedThingObtainer:
self._log_id = log_id
def _bad(self, f, validatedthingproxy):
failtype = f.trap(ServerFailure, IntegrityCheckReject, layout.LayoutInvalid, layout.ShareVersionIncompatible, DeadReferenceError)
level = log.WEIRD
if f.check(DeadReferenceError):
level = log.UNUSUAL
elif f.check(ServerFailure):
level = log.WEIRD
else:
level = log.SCARY
log.msg(parent=self._log_id, facility="tahoe.immutable.download",
format="operation %(op)s from validatedthingproxy %(validatedthingproxy)s failed",
op=self._debugname, validatedthingproxy=str(validatedthingproxy),