summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-09-05 11:32:20 +0200
committerMax Kellermann <max@musicpd.org>2016-09-05 11:32:20 +0200
commit135662d6b0714d123afa805a62462fff917943b5 (patch)
treefc9209fec7c57693c771f4501a61dcca456c7063 /src/input
parenta69c3c1848ec324975faa0dd14f0e7750c46bfee (diff)
lib/smbclient/Init: throw std::runtime_error on error
Diffstat (limited to 'src/input')
-rw-r--r--src/input/plugins/SmbclientInputPlugin.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/input/plugins/SmbclientInputPlugin.cxx b/src/input/plugins/SmbclientInputPlugin.cxx
index 66c40957e..97be5c47a 100644
--- a/src/input/plugins/SmbclientInputPlugin.cxx
+++ b/src/input/plugins/SmbclientInputPlugin.cxx
@@ -28,6 +28,8 @@
#include <libsmbclient.h>
+#include <stdexcept>
+
class SmbclientInputStream final : public InputStream {
SMBCCTX *ctx;
int fd;
@@ -66,10 +68,13 @@ public:
*/
static InputPlugin::InitResult
-input_smbclient_init(gcc_unused const ConfigBlock &block, Error &error)
+input_smbclient_init(gcc_unused const ConfigBlock &block, gcc_unused Error &error)
{
- if (!SmbclientInit(error))
+ try {
+ SmbclientInit();
+ } catch (const std::runtime_error &e) {
return InputPlugin::InitResult::UNAVAILABLE;
+ }
// TODO: create one global SMBCCTX here?