implement noripple_check

This commit is contained in:
CJ Cobb
2021-09-13 15:58:42 -04:00
parent f18c8f67e2
commit 8e877ac87c
7 changed files with 347 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ static std::unordered_map<std::string, std::function<Result(Context const&)>>
{"account_offers", &doAccountOffers},
{"account_tx", &doAccountTx},
{"gateway_balances", &doGatewayBalances},
{"noripple_check", &doNoRippleCheck},
{"book_offers", &doBookOffers},
{"channel_authorize", &doChannelAuthorize},
{"channel_verify", &doChannelVerify},
@@ -169,6 +170,23 @@ buildResponse(Context const& ctx)
auto method = handlerTable[ctx.method];
return method(ctx);
try
{
return method(ctx);
}
catch (InvalidParamsError const& err)
{
return Status{Error::rpcINVALID_PARAMS, err.what()};
}
catch (AccountNotFoundError const& err)
{
return Status{Error::rpcACT_NOT_FOUND, err.what()};
}
catch (std::exception const& err)
{
BOOST_LOG_TRIVIAL(error)
<< __func__ << " caught exception : " << err.what();
return Status{Error::rpcINTERNAL, err.what()};
}
}
} // namespace RPC