summaryrefslogtreecommitdiff
path: root/src/player
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-09-21 17:35:32 +0200
committerMax Kellermann <max@musicpd.org>2018-09-21 17:35:32 +0200
commit781e690012512e72bbfa101cba584787ddd212be (patch)
tree47353b1e646026daa9878924425a02d6476d7616 /src/player
parent9a2d71341e1f5a54ce6263e1fafbf538abe29b61 (diff)
player/Thread: catch and log initialization errors
Diffstat (limited to 'src/player')
-rw-r--r--src/player/Thread.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx
index 8ef278fd8..19869e981 100644
--- a/src/player/Thread.cxx
+++ b/src/player/Thread.cxx
@@ -1098,7 +1098,7 @@ do_play(PlayerControl &pc, DecoderControl &dc,
void
PlayerControl::RunThread() noexcept
-{
+try {
SetThreadName("player");
DecoderControl dc(mutex, cond,
@@ -1185,4 +1185,12 @@ PlayerControl::RunThread() noexcept
break;
}
}
+} catch (...) {
+ /* exceptions caught here are thrown during initialization;
+ the main loop doesn't throw */
+
+ LogError(std::current_exception());
+
+ /* TODO: what now? How will the main thread learn about this
+ failure? */
}