summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui_session.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-28 07:31:43 +0100
committerRobin Gareus <robin@gareus.org>2020-02-28 07:32:17 +0100
commit003e68edd258051a9520cd83487813d7ad71e647 (patch)
treeb9de74f12390af3402fab99074a68ee9d784db40 /gtk2_ardour/ardour_ui_session.cc
parentfa0a7d67391f7c968b31daf628bb3581bcba67d7 (diff)
Display recent session-load errors in the GUI
Dumping errors to stderr only is not very useful. Particularly not on Windows and MacOS. Even though a user may not be able to address the issue, this can lead to better reports vs just printing "corrupt state".
Diffstat (limited to 'gtk2_ardour/ardour_ui_session.cc')
-rw-r--r--gtk2_ardour/ardour_ui_session.cc32
1 files changed, 21 insertions, 11 deletions
diff --git a/gtk2_ardour/ardour_ui_session.cc b/gtk2_ardour/ardour_ui_session.cc
index 42214fac6c..9c728a4a87 100644
--- a/gtk2_ardour/ardour_ui_session.cc
+++ b/gtk2_ardour/ardour_ui_session.cc
@@ -418,28 +418,34 @@ ARDOUR_UI::load_session_stage_two (const std::string& path, const std::string& s
goto out;
}
catch (SessionException const& e) {
+ stringstream ss;
+ dump_errors (ss, 6);
+ dump_errors (cerr);
+ clear_errors ();
ArdourMessageDialog msg (string_compose(
- _("Session \"%1 (snapshot %2)\" did not load successfully:\n%3"),
- path, snap_name, e.what()),
- true,
+ _("Session \"%1 (snapshot %2)\" did not load successfully:\n%3%4%5"),
+ path, snap_name, e.what(), ss.str().empty() ? "" : "\n\n---", ss.str()),
+ false,
Gtk::MESSAGE_INFO,
BUTTONS_OK);
msg.set_title (_("Loading Error"));
msg.set_position (Gtk::WIN_POS_CENTER);
- dump_errors (cerr);
-
(void) msg.run ();
msg.hide ();
goto out;
}
catch (...) {
+ stringstream ss;
+ dump_errors (ss, 6);
+ dump_errors (cerr);
+ clear_errors ();
ArdourMessageDialog msg (string_compose(
- _("Session \"%1 (snapshot %2)\" did not load successfully."),
- path, snap_name),
+ _("Session \"%1 (snapshot %2)\" did not load successfully.%3%4"),
+ path, snap_name, ss.str().empty() ? "" : "\n\n---", ss.str()),
true,
Gtk::MESSAGE_INFO,
BUTTONS_OK);
@@ -447,8 +453,6 @@ ARDOUR_UI::load_session_stage_two (const std::string& path, const std::string& s
msg.set_title (_("Loading Error"));
msg.set_position (Gtk::WIN_POS_CENTER);
- dump_errors (cerr);
-
(void) msg.run ();
msg.hide ();
@@ -611,20 +615,26 @@ ARDOUR_UI::build_session_stage_two (std::string const& path, std::string const&
new_session = new Session (*AudioEngine::instance(), path, snap_name, bus_profile.master_out_channels > 0 ? &bus_profile : NULL, meta_session ? "" : session_template);
}
catch (SessionException const& e) {
+ stringstream ss;
+ dump_errors (ss, 6);
cerr << "Here are the errors associated with this failed session:\n";
dump_errors (cerr);
cerr << "---------\n";
- ArdourMessageDialog msg (string_compose(_("Could not create session in \"%1\": %2"), path, e.what()));
+ clear_errors ();
+ ArdourMessageDialog msg (string_compose(_("Could not create session in \"%1\": %2%3%4"), path, e.what(), ss.str().empty() ? "" : "\n\n---", ss.str()));
msg.set_title (_("Loading Error"));
msg.set_position (Gtk::WIN_POS_CENTER);
msg.run ();
return -1;
}
catch (...) {
+ stringstream ss;
+ dump_errors (ss, 6);
cerr << "Here are the errors associated with this failed session:\n";
dump_errors (cerr);
cerr << "---------\n";
- ArdourMessageDialog msg (string_compose(_("Could not create session in \"%1\""), path));
+ clear_errors ();
+ ArdourMessageDialog msg (string_compose(_("Could not create session in \"%1\"%2%3"), path, ss.str().empty() ? "" : "\n\n---", ss.str()));
msg.set_title (_("Loading Error"));
msg.set_position (Gtk::WIN_POS_CENTER);
msg.run ();