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

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

View File

@@ -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;
}

View File

@@ -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;
}