immutable: don't catch all exception when downloading, catch only DeadReferenceError...
authorZooko O'Whielacronx <zooko@zooko.com>
Mon, 22 Dec 2008 00:41:35 +0000 (17:41 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Mon, 22 Dec 2008 00:41:35 +0000 (17:41 -0700)
src/allmydata/immutable/download.py

index c6390beb7021e6a9d58ac60ea857047ba0891982..54b37a2a709d6ba268dfb259db6d73f5122daa05 100644 (file)
@@ -489,11 +489,8 @@ class BlockDownloader(log.PrefixingLogMixin):
         self.parent.hold_block(self.blocknum, data)
 
     def _got_block_error(self, f):
-        level = log.WEIRD
-        if f.check(DeadReferenceError):
-            level = log.UNUSUAL
-        self.log("BlockDownloader[%d] got error" % self.blocknum,
-                 failure=f, level=level, umid="5Z4uHQ")
+        failtype = f.trap(DeadReferenceError, IntegrityCheckReject)
+        self.log("failure to get block", level=log.UNUSUAL, umid="5Z4uHQ")
         if self.results:
             peerid = self.vbucket.bucket.get_peerid()
             self.results.server_problems[peerid] = str(f)