diff options
author | Max Kellermann <max@musicpd.org> | 2017-12-19 10:56:23 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-12-19 10:56:23 +0100 |
commit | 914df18bf93369d279fff85f87c4ac8524f32540 (patch) | |
tree | b73edeeb37923be1c124e608423ad3b5da068958 /src/queue | |
parent | a539094c06114a6be862e219bfc03d6a3513d80b (diff) |
Main, ...: catch any exception, not just std::runtime_error
Diffstat (limited to 'src/queue')
-rw-r--r-- | src/queue/PlaylistUpdate.cxx | 4 | ||||
-rw-r--r-- | src/queue/QueueSave.cxx | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/queue/PlaylistUpdate.cxx b/src/queue/PlaylistUpdate.cxx index fe6942ecd..a710a0c36 100644 --- a/src/queue/PlaylistUpdate.cxx +++ b/src/queue/PlaylistUpdate.cxx @@ -23,8 +23,6 @@ #include "db/LightSong.hxx" #include "DetachedSong.hxx" -#include <stdexcept> - static bool UpdatePlaylistSong(const Database &db, DetachedSong &song) { @@ -36,7 +34,7 @@ UpdatePlaylistSong(const Database &db, DetachedSong &song) const LightSong *original; try { original = db.GetSong(song.GetURI()); - } catch (const std::runtime_error &e) { + } catch (...) { /* not found - shouldn't happen, because the update thread should ensure that all stale Song instances have been purged */ diff --git a/src/queue/QueueSave.cxx b/src/queue/QueueSave.cxx index 05d8e2e43..4bfb54072 100644 --- a/src/queue/QueueSave.cxx +++ b/src/queue/QueueSave.cxx @@ -29,6 +29,8 @@ #include "util/StringCompare.hxx" #include "Log.hxx" +#include <exception> + #include <stdlib.h> #define PRIO_LABEL "Prio: " @@ -96,8 +98,8 @@ queue_load_song(TextFile &file, const SongLoader &loader, try { song = song_load(file, uri); - } catch (const std::runtime_error &e) { - LogError(e); + } catch (...) { + LogError(std::current_exception()); return; } } else { |