fpdb/pyfpdb/Exceptions.py

32 lines
780 B
Python
Raw Normal View History

2009-08-12 02:46:39 +02:00
class FpdbError(Exception):
2009-08-28 19:24:51 +02:00
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
2009-08-12 02:46:39 +02:00
class FpdbParseError(FpdbError):
2009-08-12 02:46:39 +02:00
def __init__(self,value='',hid=''):
self.value = value
self.hid = hid
2009-08-12 02:46:39 +02:00
def __str__(self):
if self.hid:
return repr("HID:"+self.hid+", "+self.value)
2009-08-12 02:46:39 +02:00
else:
return repr(self.value)
class FpdbDatabaseError(FpdbError):
pass
class FpdbMySQLError(FpdbDatabaseError):
pass
class FpdbMySQLAccessDenied(FpdbDatabaseError):
def __init__(self, value='', errmsg=''):
self.value = value
self.errmsg = errmsg
def __str__(self):
return repr(self.value +" " + self.errmsg)
2009-08-28 08:43:12 +02:00
class DuplicateError(FpdbError):
2009-08-28 19:24:51 +02:00
pass