Example #1
0
 def __init__(self, msg, dberr):
     assert isinstance(dberr, sa_exc.DBAPIError)
     self.sa_error = dberr
     self.db_error = dberr.orig
     if self.db_error:
         self.msg = str(self.db_error.args[1])
     else:
         self.msg = str(self.sa_error)
             
     DinoException.__init__(self, self.msg)
Example #2
0
 def __init__(self, *args): 
     DinoException.__init__(self, *args)
                     
     if hasattr(self.__class__, "MSG_STR"):
         self.args = args
         try: 
             self.msg = self.MSG_STR % tuple(args)
         except TypeError:
             self.msg = str( (self.MSG_STR,) + tuple(args) )
     else:
         self.msg = args[0]
         self.args = len(args) > 1 and args[1:] or ()        
Example #3
0
 def __init__(self, msg, code=-1, cause=None):
     DinoException.__init__(self, msg, code)
     self.msg = msg
     self.code = code