mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] [PATCH 03/83] Refactor exceptions raised by the search plugi


From: Alon Levy
Subject: [GMG-Devel] [PATCH 03/83] Refactor exceptions raised by the search plugin
Date: Tue, 25 Feb 2014 21:57:46 +0200

From: Praveen Kumar <address@hidden>

---
 mediagoblin/plugins/search/exceptions.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/mediagoblin/plugins/search/exceptions.py 
b/mediagoblin/plugins/search/exceptions.py
index 4cec51f..d12a5a5 100644
--- a/mediagoblin/plugins/search/exceptions.py
+++ b/mediagoblin/plugins/search/exceptions.py
@@ -8,16 +8,12 @@ class BaseSearchError(Exception):
     def __init__(self, msg=None):
         self.msg = msg
 
-    def __str__(self):
-        return repr(self.msg)
-
-
 class IndexDoesNotExistsError(BaseSearchError):
     """
     Raised when an index does not exist.
     """
 
-    def __init__(self, index_dir, index_name):
-        self.msg = ('Index with name %s does not exists in search', 
-                    'index directory %s'%(index_dir, index_name))
-
+    def __init__(self, msg='', index_dir='', index_name=''):
+        super(IndexDoesNotExistsError, self).__init__(msg)
+        message = 'Index with name %(name)s does not exists in search index 
%(dir)s'
+        self.msg = message.format({'name': index_name, 'dir': index_dir})
-- 
1.8.5.3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]