input/Plugin: migrate init() from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-09-05 12:05:54 +02:00
parent a73688a2be
commit 6ed77f2a27
15 changed files with 55 additions and 99 deletions

View File

@@ -40,20 +40,6 @@ class Error;
struct Tag;
struct InputPlugin {
enum class InitResult {
/**
* A fatal error has occurred (e.g. misconfiguration).
* The #Error has been set.
*/
ERROR,
/**
* The plugin was initialized successfully and is
* ready to be used.
*/
SUCCESS,
};
const char *name;
/**
@@ -61,8 +47,10 @@ struct InputPlugin {
*
* Throws #PluginUnavailable if the plugin is not available
* and shall be disabled.
*
* Throws std::runtime_error on (fatal) error.
*/
InitResult (*init)(const ConfigBlock &block, Error &error);
void (*init)(const ConfigBlock &block);
/**
* Global deinitialization. Called once before MPD shuts