From 8da09985932846a139bcf400a6194a6ec3158eb1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 18 Dec 2007 16:24:57 -0800 Subject: [PATCH] Add a MirrorError exception. Fixes the deprecated use of calling errback with a string. --- apt_dht/MirrorManager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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): -- 2.39.5