[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
- [GMG-Devel] [PATCH 00/83] Search plugin, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 01/83] Register search plugin with mediagoblin.ini, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 02/83] Correct indices storage dictionary in config_spec.ini, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 03/83] Refactor exceptions raised by the search plugin,
Alon Levy <=
- [GMG-Devel] [PATCH 04/83] Fix typos in search.models, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 05/83] Rename models.py to indices.py as these will not be stored in db., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 06/83] Remove global constants from the top of indices.py, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 07/83] Fix imports and other bugs in indices.py, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 08/83] Add schemas.py which will store all index schemas., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 09/83] Store also the field names in the SearchIndex object which is also necessary while searching., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 10/83] Correct the class index schema class., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 11/83] Add indexer for MediaEntry objects., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 12/83] Add IndexRegistry class to maintain the search indices., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 13/83] Clean up plugins.search.indices, Alon Levy, 2014/02/25