In the "Games" filter, 27_3draw was showing up as 273draw with the 3 underlined....
[fpdb-dooglus.git] / pyfpdb / Exceptions.py
blob1a0979a934aba554af75dcea06a3e7ca50185598
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.
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):
20 self.value = value
21 def __str__(self):
22 return repr(self.value)
24 class 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)
34 class FpdbDatabaseError(FpdbError):
35 pass
37 class FpdbMySQLError(FpdbDatabaseError):
38 pass
40 class 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)
47 class 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)
54 class 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)
61 class 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)
68 class FpdbHandError(FpdbError):
69 pass
71 class FpdbHandDuplicate(FpdbHandError):
72 pass
74 class FpdbHandPartial(FpdbHandError):
75 pass
77 class FpdbEndOfFile(FpdbHandError):
78 pass