error exceptions

Josh Stratton <[email protected]> Tue, 9 Aug 2011 07:17:11 -0700
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <CAPVmgLg6rjW2pF9LrNL0EoJaSR0guQQBKRARgVehwkhVQfTL=g@mail.gmail.com>
I'm trying to get error messages to display and I was following this
tutorial.  However, I can't seem to get any error exceptions.  In a
lua script I'm running, I have a print at the top and bottom and it's
only hitting the top one, so I'm assuming there is some error in there
I thought should raise an exception.

http://www.nuclex.org/articles/5-cxx/1-quick-introduction-to-luabind

void loadLuaFile(lua_State* state, QString fileName)
{
    QFile file(fileName);
    file.open(QIODevice::ReadOnly);
    QString lines = file.readAll();
    //std://:cout << lines.toStdString() << std::endl;
    try {
        std::cout << "executing " << fileName.toStdString() <<
"...\n-----------" << std::endl;
        std::cout << lines.toStdString().c_str() << std::endl;
        luaL_dostring(state, lines.toStdString().c_str());
    } catch (const std::exception &TheError) {
        std::cout << "*" << std::endl;
        std::cout << TheError.what() << std::endl;
    }

    file.close();
}

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev