PluginUnavailable: add subclass PluginUnconfigured

PluginUnconfigured exceptions are logged with level "info" instead of
"error".  This suppresses some rather boring messages in the default
log level.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/565
This commit is contained in:
Max Kellermann
2019-05-22 18:04:11 +02:00
parent 9d1906da8a
commit 40a48cfba0
4 changed files with 27 additions and 9 deletions

View File

@@ -170,15 +170,15 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block)
const char *token = block.GetBlockValue("token");
if (token == nullptr)
throw PluginUnavailable("No Tidal application token configured");
throw PluginUnconfigured("No Tidal application token configured");
const char *username = block.GetBlockValue("username");
if (username == nullptr)
throw PluginUnavailable("No Tidal username configured");
throw PluginUnconfigured("No Tidal username configured");
const char *password = block.GetBlockValue("password");
if (password == nullptr)
throw PluginUnavailable("No Tidal password configured");
throw PluginUnconfigured("No Tidal password configured");
tidal_audioquality = block.GetBlockValue("audioquality", "HIGH");