summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour_ui.cc7
-rw-r--r--gtk2_ardour/luainstance.cc48
-rw-r--r--gtk2_ardour/luawindow.cc12
-rw-r--r--gtk2_ardour/processor_box.cc2
-rw-r--r--gtk2_ardour/session_dialog.cc3
5 files changed, 54 insertions, 18 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index d3b07badb9..8d931bbbd3 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -3927,8 +3927,7 @@ ARDOUR_UI::route_setup_info (const std::string& script_path)
}
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- return rv;
- }
+ } catch (...) { }
return rv;
}
@@ -3976,6 +3975,8 @@ ARDOUR_UI::meta_route_setup (const std::string& script_path)
}
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
+ } catch (...) {
+ display_insufficient_ports_message ();
}
}
@@ -4006,6 +4007,8 @@ ARDOUR_UI::meta_session_setup (const std::string& script_path)
}
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
+ } catch (...) {
+ display_insufficient_ports_message ();
}
}
diff --git a/gtk2_ardour/luainstance.cc b/gtk2_ardour/luainstance.cc
index 15ab49e884..fe4276c39a 100644
--- a/gtk2_ardour/luainstance.cc
+++ b/gtk2_ardour/luainstance.cc
@@ -1162,6 +1162,11 @@ LuaInstance::init ()
} catch (luabridge::LuaException const& e) {
fatal << string_compose (_("programming error: %1"),
+ std::string ("Failed to setup Lua action interpreter") + e.what ())
+ << endmsg;
+ abort(); /*NOTREACHED*/
+ } catch (...) {
+ fatal << string_compose (_("programming error: %1"),
X_("Failed to setup Lua action interpreter"))
<< endmsg;
abort(); /*NOTREACHED*/
@@ -1229,7 +1234,7 @@ LuaInstance::set_state (const XMLNode& node)
(*_lua_load)(std::string ((const char*)buf, size));
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- }
+ } catch (...) { }
for (int i = 0; i < 9; ++i) {
std::string name;
if (lua_action_name (i, name)) {
@@ -1249,7 +1254,7 @@ LuaInstance::set_state (const XMLNode& node)
SlotChanged (p->id(), p->name(), p->signals()); /* EMIT SIGNAL */
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- }
+ } catch (...) { }
}
}
@@ -1340,6 +1345,10 @@ LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id)
string msg = string_compose (_("Loading Session script '%1' failed: %2"), spd.name(), e.what ());
Gtk::MessageDialog am (msg);
am.run ();
+ } catch (...) {
+ string msg = string_compose (_("Loading Session script '%1' failed: %2"), spd.name(), "Unknown Exception");
+ Gtk::MessageDialog am (msg);
+ am.run ();
}
default:
break;
@@ -1386,7 +1395,7 @@ LuaInstance::call_action (const int id)
lua.collect_garbage_step ();
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- }
+ } catch (...) { }
}
void
@@ -1403,7 +1412,7 @@ LuaInstance::render_icon (int i, cairo_t* cr, int w, int h, uint32_t clr)
(*_lua_render_icon)(i + 1, (Cairo::Context *)&ctx, w, h, clr);
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- }
+ } catch (...) { }
}
bool
@@ -1429,6 +1438,8 @@ LuaInstance::set_lua_action (
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
return false;
+ } catch (...) {
+ return false;
}
_session->set_dirty ();
return true;
@@ -1442,6 +1453,8 @@ LuaInstance::remove_lua_action (const int id)
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
return false;
+ } catch (...) {
+ return false;
}
ActionChanged (id, ""); /* EMIT SIGNAL */
_session->set_dirty ();
@@ -1463,8 +1476,7 @@ LuaInstance::lua_action_name (const int id, std::string& rv)
return true;
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- return false;
- }
+ } catch (...) { }
return false;
}
@@ -1494,7 +1506,7 @@ LuaInstance::lua_action_has_icon (const int id)
}
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- }
+ } catch (...) { }
return false;
}
@@ -1529,8 +1541,7 @@ LuaInstance::lua_action (const int id, std::string& name, std::string& script, L
return true;
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- return false;
- }
+ } catch (...) { }
return false;
}
@@ -1553,7 +1564,7 @@ LuaInstance::register_lua_slot (const std::string& name, const std::string& scri
}
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- }
+ } catch (...) { }
if (ah.none ()) {
cerr << "Script registered no hooks." << endl;
@@ -1570,7 +1581,7 @@ LuaInstance::register_lua_slot (const std::string& name, const std::string& scri
return true;
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- }
+ } catch (...) { }
_session->set_dirty ();
return false;
}
@@ -1656,11 +1667,13 @@ LuaCallback::LuaCallback (Session *s,
}
try {
- const std::string& bytecode = LuaScripting::get_factory_bytecode (script);
- (*_lua_add)(name, script, bytecode, tbl_arg);
+ const std::string& bytecode = LuaScripting::get_factory_bytecode (script);
+ (*_lua_add)(name, script, bytecode, tbl_arg);
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
throw failed_constructor ();
+ } catch (...) {
+ throw failed_constructor ();
}
_id.reset ();
@@ -1699,7 +1712,7 @@ LuaCallback::LuaCallback (Session *s, XMLNode & node)
(*_lua_load)(std::string ((const char*)buf, size));
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
- }
+ } catch (...) { }
g_free (buf);
set_session (s);
@@ -1860,6 +1873,11 @@ LuaCallback::init (void)
} catch (luabridge::LuaException const& e) {
fatal << string_compose (_("programming error: %1"),
+ std::string ("Failed to setup Lua callback interpreter: ") + e.what ())
+ << endmsg;
+ abort(); /*NOTREACHED*/
+ } catch (...) {
+ fatal << string_compose (_("programming error: %1"),
X_("Failed to setup Lua callback interpreter"))
<< endmsg;
abort(); /*NOTREACHED*/
@@ -1907,7 +1925,7 @@ LuaCallback::lua_slot (std::string& name, std::string& script, ActionHook& ah, A
} catch (luabridge::LuaException const& e) {
cerr << "LuaException:" << e.what () << endl;
return false;
- }
+ } catch (...) { }
return false;
}
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"), "..."));
}
}
}
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index a25ac0de40..543a0e2399 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -1686,7 +1686,7 @@ ProcessorEntry::LuaPluginDisplay::render_inline (cairo_t *cr, uint32_t width)
#ifndef NDEBUG
cerr << "LuaException:" << e.what () << endl;
#endif
- }
+ } catch (...) { }
return 0;
}
diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc
index d6c17e09ac..95f30ffcf7 100644
--- a/gtk2_ardour/session_dialog.cc
+++ b/gtk2_ardour/session_dialog.cc
@@ -221,8 +221,11 @@ SessionDialog::meta_master_bus_profile (std::string script_path) const
err = lua.do_file (script_path);
} catch (luabridge::LuaException const& e) {
err = -1;
+ } catch (...) {
+ err = -1;
}
+
if (err) {
return UINT32_MAX;
}