Coverage for Exceptions.py: 63%
51 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-27 18:50 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-27 18:50 +0000
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
4#Copyright 2009-2011 Matt Turnbull
5#This program is free software: you can redistribute it and/or modify
6#it under the terms of the GNU Affero General Public License as published by
7#the Free Software Foundation, version 3 of the License.
8#
9#This program is distributed in the hope that it will be useful,
10#but WITHOUT ANY WARRANTY; without even the implied warranty of
11#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12#GNU General Public License for more details.
13#
14#You should have received a copy of the GNU Affero General Public License
15#along with this program. If not, see <http://www.gnu.org/licenses/>.
16#In the "official" distribution you can find the license in agpl-3.0.txt.
18class FpdbError(Exception):
19 def __init__(self, value):
20 self.value = value
21 def __str__(self):
22 return repr(self.value)
24class FpdbParseError(FpdbError):
25 def __init__(self,value='',hid=''):
26 self.value = value
27 self.hid = hid
28 def __str__(self):
29 if self.hid:
30 return repr("HID:"+self.hid+", "+self.value)
31 else:
32 return repr(self.value)
34class FpdbDatabaseError(FpdbError):
35 pass
37class FpdbMySQLError(FpdbDatabaseError):
38 pass
40class FpdbMySQLAccessDenied(FpdbDatabaseError):
41 def __init__(self, value='', errmsg=''):
42 self.value = value
43 self.errmsg = errmsg
44 def __str__(self):
45 return repr(self.value +" " + self.errmsg)
47class FpdbMySQLNoDatabase(FpdbDatabaseError):
48 def __init__(self, value='', errmsg=''):
49 self.value = value
50 self.errmsg = errmsg
51 def __str__(self):
52 return repr(self.value +" " + self.errmsg)
54class FpdbPostgresqlAccessDenied(FpdbDatabaseError):
55 def __init__(self, value='', errmsg=''):
56 self.value = value
57 self.errmsg = errmsg
58 def __str__(self):
59 return repr(self.value +" " + self.errmsg)
61class FpdbPostgresqlNoDatabase(FpdbDatabaseError):
62 def __init__(self, value='', errmsg=''):
63 self.value = value
64 self.errmsg = errmsg
65 def __str__(self):
66 return repr(self.value +" " + self.errmsg)
68class FpdbHandError(FpdbError):
69 pass
71class FpdbHandDuplicate(FpdbHandError):
72 pass
74class FpdbHandPartial(FpdbParseError):
75 pass
77class FpdbHandSkipped(FpdbParseError):
78 pass
80class FpdbEndOfFile(FpdbHandError):
81 pass