Disambiguate rpcSRC_ACT_NOT_FOUND errors so it's clear when it's the

secret that's at fault.
This commit is contained in:
JoelKatz
2013-02-19 13:48:46 -08:00
parent 637b7e5431
commit 7c7944a82c
3 changed files with 3 additions and 1 deletions

View File

@@ -60,6 +60,7 @@ Json::Value rpcError(int iError, Json::Value jvResult)
{ rpcSRC_ACT_MALFORMED, "srcActMalformed", "Source account is malformed." },
{ rpcSRC_ACT_MISSING, "srcActMissing", "Source account not provided." },
{ rpcSRC_ACT_NOT_FOUND, "srcActNotFound", "Source account not found." },
{ rpcBAD_SECRET, "badSecret", "Secret does not match account." },
{ rpcSRC_AMT_MALFORMED, "srcAmtMalformed", "Source amount/currency/issuer is malformed." },
{ rpcSRC_CUR_MALFORMED, "srcCurMalformed", "Source currency is malformed." },
{ rpcSRC_ISR_MALFORMED, "srcIsrMalformed", "Source issuer is malformed." },

View File

@@ -67,6 +67,7 @@ enum {
rpcSRC_AMT_MALFORMED,
rpcSRC_CUR_MALFORMED,
rpcSRC_ISR_MALFORMED,
rpcBAD_SECRET,
// Internal error (should never happen)
rpcINTERNAL, // Generic internal error.

View File

@@ -251,7 +251,7 @@ Json::Value RPCHandler::transactionSign(Json::Value jvRequest, bool bSubmit)
if (!bFound)
{
return rpcError(rpcSRC_ACT_NOT_FOUND);
return rpcError(rpcBAD_SECRET);
}
// Use the generator to determine the associated public and private keys.