def defaulterrorhandler(connection, cursor, errorclass, errorvalue):
    error = errorclass, errorvalue
    if cursor:
        cursor.messages.append(error)
    else:
        connection.messages.append(error)
    del cursor
    del connection
    raise errorclass, errorvalue
If cursor is not None, (errorclass, errorvalue) is appended to
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/connections.py/defaulterrorhandler