diff options
author | Max Kellermann <max@musicpd.org> | 2019-06-26 22:01:45 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-06-26 22:01:45 +0200 |
commit | 85e82e3d4d7c8fa9947768c1819eeb4aa963c1bd (patch) | |
tree | 27a85e74fb944532542475613e771283e781dda3 /src/decoder | |
parent | f44011519c8c93af9e07e90130cf01f7f6b9fa2b (diff) |
decoder/List: annotate exceptions thrown by DecoderPlugin::Init()
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/DecoderList.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/decoder/DecoderList.cxx b/src/decoder/DecoderList.cxx index 286136826..510a45e20 100644 --- a/src/decoder/DecoderList.cxx +++ b/src/decoder/DecoderList.cxx @@ -45,6 +45,7 @@ #include "plugins/FluidsynthDecoderPlugin.hxx" #include "plugins/SidplayDecoderPlugin.hxx" #include "util/Macros.hxx" +#include "util/RuntimeError.hxx" #include <string.h> @@ -147,8 +148,13 @@ decoder_plugin_init_all(const ConfigData &config) if (param != nullptr) param->SetUsed(); - if (plugin.Init(*param)) - decoder_plugins_enabled[i] = true; + try { + if (plugin.Init(*param)) + decoder_plugins_enabled[i] = true; + } catch (...) { + std::throw_with_nested(FormatRuntimeError("Failed to initialize decoder plugin '%s'", + plugin.name)); + } } } |