No longer mess with sys.argv (messing with system variables is a bad thing, right), use argv to determine pathname of executeable as sys.path[0] is just the first component of the path. also all database errors except MySQL reporting "Access Denied" should now crash FPDB, so someone can fill those into Exceptions, and into the fpdb_db and the fpdb files.

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.
This commit is contained in:
Eric Blade
2009-11-22 00:00:23 -05:00
parent 14ccde73a2
commit 64d9a3582b
6 changed files with 146 additions and 128 deletions
+9 -2
View File
@@ -4,7 +4,7 @@ class FpdbError(Exception):
def __str__(self):
return repr(self.value)
class FpdbParseError(FpdbError):
class FpdbParseError(FpdbError):
def __init__(self,value='',hid=''):
self.value = value
self.hid = hid
@@ -17,8 +17,15 @@ class FpdbParseError(FpdbError):
class FpdbDatabaseError(FpdbError):
pass
class FpdbMySQLFailedError(FpdbDatabaseError):
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