summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-01-23 18:55:16 +0100
committerMax Kellermann <max@musicpd.org>2017-01-23 18:55:18 +0100
commitf01eb2f95d0030b067d9226a1ef0ce32e54ce909 (patch)
tree7ad6670c0cafab64bfd8127508990cdd62e9e0ad
parent1450e45d97aab94544f5e0e5d7c592edc9bba7a3 (diff)
db/proxy: improve Connect() error message
-rw-r--r--src/db/plugins/ProxyDatabasePlugin.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx
index f84645bec..983c0a704 100644
--- a/src/db/plugins/ProxyDatabasePlugin.cxx
+++ b/src/db/plugins/ProxyDatabasePlugin.cxx
@@ -34,6 +34,7 @@
#include "tag/TagBuilder.hxx"
#include "tag/Tag.hxx"
#include "util/ScopeExit.hxx"
+#include "util/RuntimeError.hxx"
#include "protocol/Ack.hxx"
#include "event/SocketMonitor.hxx"
#include "event/IdleMonitor.hxx"
@@ -371,7 +372,10 @@ ProxyDatabase::Connect()
mpd_connection_free(connection);
connection = nullptr;
- throw;
+ std::throw_with_nested(host.empty()
+ ? std::runtime_error("Failed to connect to remote MPD")
+ : FormatRuntimeError("Failed to connect to remote MPD '%s'",
+ host.c_str()));
}
#if LIBMPDCLIENT_CHECK_VERSION(2, 10, 0)