input/Plugin: remove InitResult::UNAVAILABLE, throw PluginUnavailable instead

This commit is contained in:
Max Kellermann
2016-09-09 15:11:52 +02:00
parent e7d327226a
commit a73688a2be
7 changed files with 57 additions and 34 deletions

View File

@@ -23,6 +23,7 @@
#include "lib/smbclient/Mutex.hxx"
#include "../InputStream.hxx"
#include "../InputPlugin.hxx"
#include "PluginUnavailable.hxx"
#include "util/StringCompare.hxx"
#include "util/Error.hxx"
@@ -73,7 +74,8 @@ input_smbclient_init(gcc_unused const ConfigBlock &block, gcc_unused Error &erro
try {
SmbclientInit();
} catch (const std::runtime_error &e) {
return InputPlugin::InitResult::UNAVAILABLE;
// TODO: use std::throw_with_nested()?
throw PluginUnavailable(e.what());
}
// TODO: create one global SMBCCTX here?