fpdb/pyfpdb/Exceptions.py

59 lines
1.5 KiB
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)
class FpdbMySQLNoDatabase(FpdbDatabaseError):
def __init__(self, value='', errmsg=''):
self.value = value
self.errmsg = errmsg
def __str__(self):
return repr(self.value +" " + self.errmsg)
class FpdbPostgresqlAccessDenied(FpdbDatabaseError):
def __init__(self, value='', errmsg=''):
self.value = value
self.errmsg = errmsg
def __str__(self):
return repr(self.value +" " + self.errmsg)
class FpdbPostgresqlNoDatabase(FpdbDatabaseError):
def __init__(self, value='', errmsg=''):
self.value = value
self.errmsg = errmsg
def __str__(self):
return repr(self.value +" " + self.errmsg)
class FpdbHandError(FpdbError):
pass
class FpdbHandDuplicate(FpdbHandError):
pass
class FpdbHandPartial(FpdbHandError):
2009-08-28 19:24:51 +02:00
pass