| 344 | } |
| 345 | |
| 346 | UniValue JSONRPCExec(const JSONRPCRequest& jreq, bool catch_errors) |
| 347 | { |
| 348 | UniValue result; |
| 349 | if (catch_errors) { |
| 350 | try { |
| 351 | result = tableRPC.execute(jreq); |
| 352 | } catch (UniValue& e) { |
| 353 | return JSONRPCReplyObj(NullUniValue, std::move(e), jreq.id, jreq.m_json_version); |
| 354 | } catch (const std::exception& e) { |
| 355 | return JSONRPCReplyObj(NullUniValue, JSONRPCError(RPC_MISC_ERROR, e.what()), jreq.id, jreq.m_json_version); |
| 356 | } |
| 357 | } else { |
| 358 | result = tableRPC.execute(jreq); |
| 359 | } |
| 360 | |
| 361 | return JSONRPCReplyObj(std::move(result), NullUniValue, jreq.id, jreq.m_json_version); |
| 362 | } |
| 363 | |
| 364 | /** |
| 365 | * Process named arguments into a vector of positional arguments, based on the |
no test coverage detected