Commit 0abaa3ec authored by Max Kellermann's avatar Max Kellermann

decoder/wildmidi: throw PluginUnavailable if config file does not exist

This makes the configuration error more visible, possibly addressing one part of https://github.com/MusicPlayerDaemon/MPD/issues/589
parent c4d3efe7
......@@ -21,10 +21,12 @@
#include "../DecoderAPI.hxx"
#include "tag/Handler.hxx"
#include "util/Domain.hxx"
#include "util/StringFormat.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#include "fs/Path.hxx"
#include "Log.hxx"
#include "PluginUnavailable.hxx"
extern "C" {
#include <wildmidi_lib.h>
......@@ -43,10 +45,8 @@ wildmidi_init(const ConfigBlock &block)
if (!FileExists(path)) {
const auto utf8 = path.ToUTF8();
FormatDebug(wildmidi_domain,
"configuration file does not exist: %s",
utf8.c_str());
return false;
throw PluginUnavailable(StringFormat<1024>("configuration file does not exist: %s",
utf8.c_str()));
}
return WildMidi_Init(path.c_str(), wildmidi_audio_format.sample_rate,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment