From: Cameron Date: Wed, 19 Dec 2007 00:24:57 +0000 (-0800) Subject: Add a MirrorError exception. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8da09985932846a139bcf400a6194a6ec3158eb1;p=quix0rs-apt-p2p.git Add a MirrorError exception. Fixes the deprecated use of calling errback with a string. --- diff --git a/apt_dht/MirrorManager.py b/apt_dht/MirrorManager.py index c2d8339..dd8030a 100644 --- a/apt_dht/MirrorManager.py +++ b/apt_dht/MirrorManager.py @@ -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):