errors.py
def errorhandler_wrapper(connection, cursor, errorclass, errorvalue=None):
        u"""
        Error handler wrapper that calls the errorhandler method
        """
        if errorvalue is None:
            # no value indicates errorclass is errorobject
            errorobject = errorclass
            errorclass = type(errorobject)
            errorvalue = {
                u'msg': errorobject.msg,
                u'errno': errorobject.errno,
                u'sqlstate': errorobject.sqlstate,
                u'done_format_msg': True
            }
        else:
            errorvalue[u'done_format_msg'] = False

        if connection is not None:
            connection.messages.append((errorclass, errorvalue))
        if cursor is not None:
            cursor.messages.append((errorclass, errorvalue))
            cursor.errorhandler(connection, cursor, errorclass, errorvalue)
            return
        elif connection is not None:
            connection.errorhandler(connection, cursor, errorclass, errorvalue)
            return

        if issubclass(errorclass, Error):
            raise errorclass(msg=errorvalue[u'msg'],
                             errno=errorvalue.get(u'errno'),
                             sqlstate=errorvalue.get(u'sqlstate'),
                             sfqid=errorvalue.get(u'sfqid'))
        else:
            raise errorclass(errorvalue)
u"""
        Error handler wrapper that calls the errorhandler method
        
u"""
Error handler wrapper that calls the errorhandler method
u " " " Error handler wrapper that calls the errorhandler method
def errorhandler_wrapper(connection, cursor, errorclass, errorvalue=None):
        if errorvalue is None:
            errorobject = errorclass
            errorclass = type(errorobject)
            errorvalue = {
                u'msg': errorobject.msg,
                u'errno': errorobject.errno,
                u'sqlstate': errorobject.sqlstate,
                u'done_format_msg': True
            }
        else:
            errorvalue[u'done_format_msg'] = False
        if connection is not None:
            connection.messages.append((errorclass, errorvalue))
        if cursor is not None:
            cursor.messages.append((errorclass, errorvalue))
            cursor.errorhandler(connection, cursor, errorclass, errorvalue)
            return
        elif connection is not None:
            connection.errorhandler(connection, cursor, errorclass, errorvalue)
            return
        if issubclass(errorclass, Error):
            raise errorclass(msg=errorvalue[u'msg'],
                             errno=errorvalue.get(u'errno'),
                             sqlstate=errorvalue.get(u'sqlstate'),
                             sfqid=errorvalue.get(u'sfqid'))
        else:
            raise errorclass(errorvalue)
def errorhandler_wrapper ( connection , cursor , errorclass , errorvalue = None ) : if errorvalue is None : errorobject = errorclass errorclass = type ( errorobject ) errorvalue = { u'msg' : errorobject . msg , u'errno' : errorobject . errno , u'sqlstate' : errorobject . sqlstate , u'done_format_msg' : True } else : errorvalue [ u'done_format_msg' ] = False if connection is not None : connection . messages . append ( ( errorclass , errorvalue ) ) if cursor is not None : cursor . messages . append ( ( errorclass , errorvalue ) ) cursor . errorhandler ( connection , cursor , errorclass , errorvalue ) return elif connection is not None : connection . errorhandler ( connection , cursor , errorclass , errorvalue ) return if issubclass ( errorclass , Error ) : raise errorclass ( msg = errorvalue [ u'msg' ] , errno = errorvalue . get ( u'errno' ) , sqlstate = errorvalue . get ( u'sqlstate' ) , sfqid = errorvalue . get ( u'sfqid' ) ) else : raise errorclass ( errorvalue )
u"""
Error handler wrapper that calls the errorhandler method
u " " " Error handler wrapper that calls the errorhandler method
u"""
        Error handler wrapper that calls the errorhandler method
        """ # no value indicates errorclass is errorobject
connection
cursor
errorclass
errorvalue