input/smbclient: use std::throw_with_nested() to construct PluginUnavailable
Preserve the original exception.
This commit is contained in:
		| @@ -28,8 +28,6 @@ | |||||||
|  |  | ||||||
| #include <libsmbclient.h> | #include <libsmbclient.h> | ||||||
|  |  | ||||||
| #include <stdexcept> |  | ||||||
|  |  | ||||||
| class SmbclientInputStream final : public InputStream { | class SmbclientInputStream final : public InputStream { | ||||||
| 	SMBCCTX *ctx; | 	SMBCCTX *ctx; | ||||||
| 	int fd; | 	int fd; | ||||||
| @@ -72,9 +70,8 @@ input_smbclient_init(EventLoop &, const ConfigBlock &) | |||||||
| { | { | ||||||
| 	try { | 	try { | ||||||
| 		SmbclientInit(); | 		SmbclientInit(); | ||||||
| 	} catch (const std::runtime_error &e) { | 	} catch (...) { | ||||||
| 		// TODO: use std::throw_with_nested()? | 		std::throw_with_nested(PluginUnavailable("libsmbclient initialization failed")); | ||||||
| 		throw PluginUnavailable(e.what()); |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// TODO: create one global SMBCCTX here? | 	// TODO: create one global SMBCCTX here? | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann