summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-06-27 20:28:45 +0200
committerRobin Gareus <robin@gareus.org>2017-06-27 20:28:45 +0200
commit1f5013b4a872a5a59a14705aa07331baaff5f77f (patch)
tree5431c34c61f2cd6c6168a73177e69fdbc795b6d9 /libs/ardour/session_state.cc
parent1dd4aab0b4d3e14ef93ddb3470d4c386f48cda6b (diff)
Distinguish error-messages.
The vast majority of errors reported by users as "Cannot configure audio/midi engine with session parameters" have nothing to do with engine-parameters.
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 1bf604ea93..5e1525dbed 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -265,7 +265,15 @@ Session::post_engine_init ()
_tempo_map = new TempoMap (_current_frame_rate);
_tempo_map->PropertyChanged.connect_same_thread (*this, boost::bind (&Session::tempo_map_changed, this, _1));
_tempo_map->MetricPositionChanged.connect_same_thread (*this, boost::bind (&Session::tempo_map_changed, this, _1));
+ } catch (std::exception const & e) {
+ error << _("Unexpected exception during session setup: ") << e.what() << endmsg;
+ return -2;
+ } catch (...) {
+ error << _("Unknown exception during session setup") << endmsg;
+ return -3;
+ }
+ try {
/* MidiClock requires a tempo map */
delete midi_clock;
@@ -288,7 +296,7 @@ Session::post_engine_init ()
if (state_tree) {
if (set_state (*state_tree->root(), Stateful::loading_state_version)) {
error << _("Could not set session state from XML") << endmsg;
- return -1;
+ return -4;
}
} else {
// set_state() will call setup_raid_path(), but if it's a new session we need
@@ -351,15 +359,14 @@ Session::post_engine_init ()
_locations->changed.connect_same_thread (*this, boost::bind (&Session::locations_changed, this));
} catch (AudioEngine::PortRegistrationFailure& err) {
- /* handle this one in a different way than all others, so that its clear what happened */
error << err.what() << endmsg;
- return -1;
+ return -5;
} catch (std::exception const & e) {
error << _("Unexpected exception during session setup: ") << e.what() << endmsg;
- return -1;
+ return -6;
} catch (...) {
error << _("Unknown exception during session setup") << endmsg;
- return -1;
+ return -7;
}
BootMessage (_("Reset Remote Controls"));