mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Lua may call C++ functions with throw. Catch them
This commit is contained in:
parent
fb745cc5a8
commit
2cc32456ab
5 changed files with 54 additions and 18 deletions
|
|
@ -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"), "..."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue