Add a MirrorError exception.
authorCameron <camrdale@stevepad.(none)>
Wed, 19 Dec 2007 00:24:57 +0000 (16:24 -0800)
committerCameron <camrdale@stevepad.(none)>
Wed, 19 Dec 2007 00:24:57 +0000 (16:24 -0800)
Fixes the deprecated use of calling errback with a string.

apt_dht/MirrorManager.py

index c2d83398e0893dfd6e37e003510f7f40a0d3b58e..dd8030a2c5b08cffbbe62923a10ca8260389c553 100644 (file)
@@ -9,6 +9,9 @@ from AptPackages import AptPackages
 
 aptpkg_dir='.apt-dht'
 
+class MirrorError(Exception):
+    """Exception raised when there's a problem with the mirror."""
+
 class MirrorManager:
     """Manages all requests for mirror objects."""
     
@@ -68,7 +71,7 @@ class MirrorManager:
         if site in self.apt_caches and baseDir in self.apt_caches[site]:
             return self.apt_caches[site][baseDir].findHash(path)
         d = defer.Deferred()
-        d.errback("Not Found")
+        d.errback(MirrorError("Site Not Found"))
         return d
 
 class TestMirrorManager(unittest.TestCase):