Main, ...: catch any exception, not just std::runtime_error

This commit is contained in:
Max Kellermann
2017-12-19 10:56:23 +01:00
parent a539094c06
commit 914df18bf9
79 changed files with 236 additions and 244 deletions

View File

@@ -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 */

View File

@@ -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 {