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/playlist | |
parent | a539094c06114a6be862e219bfc03d6a3513d80b (diff) |
Main, ...: catch any exception, not just std::runtime_error
Diffstat (limited to 'src/playlist')
-rw-r--r-- | src/playlist/PlaylistRegistry.cxx | 6 | ||||
-rw-r--r-- | src/playlist/PlaylistSong.cxx | 4 | ||||
-rw-r--r-- | src/playlist/PlaylistStream.cxx | 14 |
3 files changed, 10 insertions, 14 deletions
diff --git a/src/playlist/PlaylistRegistry.cxx b/src/playlist/PlaylistRegistry.cxx index de143b412..98894bba8 100644 --- a/src/playlist/PlaylistRegistry.cxx +++ b/src/playlist/PlaylistRegistry.cxx @@ -38,8 +38,6 @@ #include "config/ConfigGlobal.hxx" #include "config/Block.hxx" -#include <stdexcept> - #include <assert.h> #include <string.h> @@ -196,7 +194,7 @@ playlist_list_open_stream_mime2(InputStreamPtr &&is, const char *mime) fresh start */ try { is->LockRewind(); - } catch (const std::runtime_error &) { + } catch (...) { } auto playlist = playlist_plugin_open_stream(plugin, @@ -240,7 +238,7 @@ playlist_list_open_stream_suffix(InputStreamPtr &&is, const char *suffix) fresh start */ try { is->LockRewind(); - } catch (const std::runtime_error &) { + } catch (...) { } auto playlist = playlist_plugin_open_stream(plugin, diff --git a/src/playlist/PlaylistSong.cxx b/src/playlist/PlaylistSong.cxx index 12cd4bdb0..f3568500c 100644 --- a/src/playlist/PlaylistSong.cxx +++ b/src/playlist/PlaylistSong.cxx @@ -26,8 +26,6 @@ #include "util/UriUtil.hxx" #include "DetachedSong.hxx" -#include <stdexcept> - #include <string.h> static void @@ -53,7 +51,7 @@ try { merge_song_metadata(song, tmp); return true; -} catch (const std::runtime_error &) { +} catch (...) { return false; } diff --git a/src/playlist/PlaylistStream.cxx b/src/playlist/PlaylistStream.cxx index fe41eb8b6..34fdc86d6 100644 --- a/src/playlist/PlaylistStream.cxx +++ b/src/playlist/PlaylistStream.cxx @@ -26,7 +26,7 @@ #include "fs/Path.hxx" #include "Log.hxx" -#include <stdexcept> +#include <exception> #include <assert.h> @@ -46,8 +46,8 @@ try { auto is = OpenLocalInputStream(path, mutex, cond); return playlist_list_open_stream_suffix(std::move(is), suffix_utf8.c_str()); -} catch (const std::runtime_error &e) { - LogError(e); +} catch (...) { + LogError(std::current_exception()); return nullptr; } @@ -64,8 +64,8 @@ try { playlist = playlist_open_path_suffix(path, mutex, cond); return playlist; -} catch (const std::runtime_error &e) { - LogError(e); +} catch (...) { + LogError(std::current_exception()); return nullptr; } @@ -80,7 +80,7 @@ try { auto is = InputStream::OpenReady(uri, mutex, cond); return playlist_list_open_stream(std::move(is), uri); -} catch (const std::runtime_error &e) { - LogError(e); +} catch (...) { + LogError(std::current_exception()); return nullptr; } |