decoder/List: annotate exceptions thrown by DecoderPlugin::Init()

This commit is contained in:
Max Kellermann 2019-06-26 22:01:45 +02:00
parent f44011519c
commit 85e82e3d4d

View File

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