OSDN Git Service

ns_search: change search index structure - store metadata to file
[newslash/newslash.git] / src / ns_search / newslash_index / exceptions.py
1 # -*- coding: utf-8 -*-
2 '''exceptions: define exceptions'''
3
4 class NewslashIndexError(Exception):
5     def __str__(self):
6         return self.message
7
8
9 class ConfigFileError(NewslashIndexError):
10     SECTION_NOT_FOUND = "Section not found"
11     PARAMETER_NOT_FOUND = "Parameter not found"
12     def __init__(self, reason, section=""):
13         self.message = "Config Error - {}: {}".format(reason, section)
14
15
16 class DocumentMakingError(NewslashIndexError):
17     def __init__(self, message="error while document making"):
18         self.message = message
19
20
21 class DatabaseError(NewslashIndexError):
22     def __init__(self, message="datagbase error"):
23         self.message = message