Improve json exception handling

This commit is contained in:
seelabs
2018-05-24 21:20:30 -04:00
parent f31ca2860f
commit 00df097e5f
4 changed files with 100 additions and 49 deletions

View File

@@ -363,6 +363,7 @@ int PathRequest::parseJson (Json::Value const& jvParams)
Currency srcCurrencyID;
if (! c.isObject() ||
! c.isMember(jss::currency) ||
! c[jss::currency].isString() ||
! to_currency(srcCurrencyID, c[jss::currency].asString()))
{
jvStatus = rpcError (rpcSRC_CUR_MALFORMED);