mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
rpc: Use type-safe exception to pass RPC help
This commit is contained in:
@@ -97,11 +97,8 @@ std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest&
|
||||
UniValue unused_result;
|
||||
if (setDone.insert(pcmd->unique_id).second)
|
||||
pcmd->actor(jreq, unused_result, /*last_handler=*/true);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Help text is returned in an exception
|
||||
std::string strHelp = std::string(e.what());
|
||||
} catch (const HelpResult& e) {
|
||||
std::string strHelp{e.what()};
|
||||
if (strCommand == "")
|
||||
{
|
||||
if (strHelp.find('\n') != std::string::npos)
|
||||
|
||||
Reference in New Issue
Block a user