From 437ab7b6ae1e6562d48de2b8cb3ca26fd05aa365 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 3 Oct 2012 20:29:44 -0700 Subject: [PATCH] Put RPC commands in a try catch. --- src/RPCServer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index fb560045e0..3790691058 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -2729,7 +2729,13 @@ Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params } else { - return (this->*(commandsA[i].dfpFunc))(params); + try { + return (this->*(commandsA[i].dfpFunc))(params); + } + catch (...) + { + return RPCError(rpcINTERNAL); + } } }