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.
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.
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.
18 class FpdbError(Exception):
19 def __init__(self
, value
):
22 return repr(self
.value
)
24 class FpdbParseError(FpdbError
):
25 def __init__(self
,value
='',hid
=''):
30 return repr("HID:"+self
.hid
+", "+self
.value
)
32 return repr(self
.value
)
34 class FpdbDatabaseError(FpdbError
):
37 class FpdbMySQLError(FpdbDatabaseError
):
40 class FpdbMySQLAccessDenied(FpdbDatabaseError
):
41 def __init__(self
, value
='', errmsg
=''):
45 return repr(self
.value
+" " + self
.errmsg
)
47 class FpdbMySQLNoDatabase(FpdbDatabaseError
):
48 def __init__(self
, value
='', errmsg
=''):
52 return repr(self
.value
+" " + self
.errmsg
)
54 class FpdbPostgresqlAccessDenied(FpdbDatabaseError
):
55 def __init__(self
, value
='', errmsg
=''):
59 return repr(self
.value
+" " + self
.errmsg
)
61 class FpdbPostgresqlNoDatabase(FpdbDatabaseError
):
62 def __init__(self
, value
='', errmsg
=''):
66 return repr(self
.value
+" " + self
.errmsg
)
68 class FpdbHandError(FpdbError
):
71 class FpdbHandDuplicate(FpdbHandError
):
74 class FpdbHandPartial(FpdbHandError
):
77 class FpdbEndOfFile(FpdbHandError
):