diff options
author | Robin Gareus <robin@gareus.org> | 2017-08-19 01:05:08 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-08-19 01:06:44 +0200 |
commit | 2cc32456ab5bfce4f21d10b28e40f44293c987aa (patch) | |
tree | 25597747939d244f51e3a296e3cf7799936b4ff2 /gtk2_ardour/luawindow.cc | |
parent | fb745cc5a882cd4e3a49ff1f565cb69a65575993 (diff) |
Lua may call C++ functions with throw. Catch them
Diffstat (limited to 'gtk2_ardour/luawindow.cc')
-rw-r--r-- | gtk2_ardour/luawindow.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk2_ardour/luawindow.cc b/gtk2_ardour/luawindow.cc index 72f0af6980..89a1d387aa 100644 --- a/gtk2_ardour/luawindow.cc +++ b/gtk2_ardour/luawindow.cc @@ -286,6 +286,12 @@ LuaWindow::run_script () } } catch (luabridge::LuaException const& e) { append_text (string_compose (_("LuaException: %1"), e.what())); + } catch (Glib::Exception const& e) { + append_text (string_compose (_("Glib Exception: %1"), e.what())); + } catch (std::exception const& e) { + append_text (string_compose (_("C++ Exception: %1"), e.what())); + } catch (...) { + append_text (string_compose (_("C++ Exception: %1"), "...")); } } else { // script with factory method @@ -304,6 +310,12 @@ LuaWindow::run_script () lua->do_command ("factory = nil;"); } catch (luabridge::LuaException const& e) { append_text (string_compose (_("LuaException: %1"), e.what())); + } catch (Glib::Exception const& e) { + append_text (string_compose (_("Glib Exception: %1"), e.what())); + } catch (std::exception const& e) { + append_text (string_compose (_("C++ Exception: %1"), e.what())); + } catch (...) { + append_text (string_compose (_("C++ Exception: %1"), "...")); } } } |