diff options
author | Robin Gareus <robin@gareus.org> | 2020-04-18 18:13:14 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-18 18:16:12 +0200 |
commit | a2f07f66a5a42553adf1021970bd5c20849df13e (patch) | |
tree | 7bfcfb868c613f3f591801d4b8cd35b9ce80b707 /libs/ardour/luascripting.cc | |
parent | a4cfdd338df0f15be3c983fd9e22988f97b66fed (diff) |
Consistent Lua script error and print() output 1/2
Diffstat (limited to 'libs/ardour/luascripting.cc')
-rw-r--r-- | libs/ardour/luascripting.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/ardour/luascripting.cc b/libs/ardour/luascripting.cc index 156c9bbe66..bf26074011 100644 --- a/libs/ardour/luascripting.cc +++ b/libs/ardour/luascripting.cc @@ -220,12 +220,20 @@ LuaScripting::scan_script (const std::string &fn, const std::string &sc) #endif return LuaScriptInfoPtr(); } - } catch (...) { // luabridge::LuaException + } catch (luabridge::LuaException const& e) { +#ifndef NDEBUG + cerr << "Exception: Failed to parse lua script fn: '"<< fn << "' " << e.what () << "\n"; +#endif + PBD::warning << "Exception: Failed to parse lua script fn: '"<< fn << "' " << e.what () << "\n"; + return LuaScriptInfoPtr(); + } catch (...) { #ifndef NDEBUG - cerr << "failed to parse lua script\n"; + cerr << "Exception: Failed to parse lua script fn: '"<< fn << "'\n"; #endif + PBD::warning << "Exception: Failed to parse lua script fn: '"<< fn << "'\n"; return LuaScriptInfoPtr(); } + luabridge::LuaRef nfo = luabridge::getGlobal (L, "ardourluainfo"); if (nfo.type() != LUA_TTABLE) { #ifndef NDEBUG |