From c4d3efe71dbe96c12fb5623ed2213ed7cd998da9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 26 Jun 2019 22:02:20 +0200 Subject: [PATCH] decoder/List: handle exception PluginUnavailable --- src/decoder/DecoderList.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/decoder/DecoderList.cxx b/src/decoder/DecoderList.cxx index 510a45e20..654f5e8f6 100644 --- a/src/decoder/DecoderList.cxx +++ b/src/decoder/DecoderList.cxx @@ -20,6 +20,8 @@ #include "config.h" #include "DecoderList.hxx" #include "DecoderPlugin.hxx" +#include "PluginUnavailable.hxx" +#include "Log.hxx" #include "config/Data.hxx" #include "config/Block.hxx" #include "plugins/AudiofileDecoderPlugin.hxx" @@ -151,6 +153,10 @@ decoder_plugin_init_all(const ConfigData &config) try { if (plugin.Init(*param)) decoder_plugins_enabled[i] = true; + } catch (const PluginUnavailable &e) { + FormatError(e, + "Decoder plugin '%s' is unavailable", + plugin.name); } catch (...) { std::throw_with_nested(FormatRuntimeError("Failed to initialize decoder plugin '%s'", plugin.name));