64d9a3582b
Process: get crash info, add exception info to Exceptions.py, catch generic database exception in fpdb_db.py (around the connect line), throw correct Fpdb exception, then catch it in fpdb.py and do the appropriate thing on the GUI end.
32 lines
780 B
Python
32 lines
780 B
Python
class FpdbError(Exception):
|
|
def __init__(self, value):
|
|
self.value = value
|
|
def __str__(self):
|
|
return repr(self.value)
|
|
|
|
class FpdbParseError(FpdbError):
|
|
def __init__(self,value='',hid=''):
|
|
self.value = value
|
|
self.hid = hid
|
|
def __str__(self):
|
|
if self.hid:
|
|
return repr("HID:"+self.hid+", "+self.value)
|
|
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 DuplicateError(FpdbError):
|
|
pass
|