aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/server.cpp')
-rw-r--r--src/rpc/server.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
index e9987d73be..46f5ecd748 100644
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -468,8 +468,7 @@ UniValue CRPCTable::execute(const JSONRPCRequest &request) const
static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler)
{
- try
- {
+ try {
RPCCommandExecution execution(request.strMethod);
// Execute, convert arguments to array if necessary
if (request.params.isObject()) {
@@ -477,9 +476,9 @@ static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& req
} else {
return command.actor(request, result, last_handler);
}
- }
- catch (const std::exception& e)
- {
+ } catch (const UniValue::type_error& e) {
+ throw JSONRPCError(RPC_TYPE_ERROR, e.what());
+ } catch (const std::exception& e) {
throw JSONRPCError(RPC_MISC_ERROR, e.what());
}
}