From ab6dfadc5f1852bae8f03dacb272fdd8ce909abf Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 10 Oct 2012 12:44:00 -0700 Subject: [PATCH] Have RPCServer report messages from throws. --- src/RPCServer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index 0723e7936..ca1eb0dc1 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -2738,8 +2738,10 @@ Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params try { return (this->*(commandsA[i].dfpFunc))(params); } - catch (...) + catch (std::exception& e) { + cLog(lsINFO) << "Caught throw: " << e.what(); + return RPCError(rpcINTERNAL); } }