mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Improved local tx error messages (RIPD-720)
Failed local built transactions report the specific error.
This commit is contained in:
committed by
Tom Ritchford
parent
1fedede771
commit
5e70db651d
@@ -64,23 +64,12 @@ Json::Value doSubmit (RPC::Context& context)
|
||||
}
|
||||
|
||||
Transaction::pointer tpTrans;
|
||||
|
||||
try
|
||||
{
|
||||
tpTrans = std::make_shared<Transaction> (stpTrans, Validate::YES);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
jvResult[jss::error] = "internalTransaction";
|
||||
jvResult[jss::error_exception] = e.what ();
|
||||
|
||||
return jvResult;
|
||||
}
|
||||
|
||||
std::string reason;
|
||||
tpTrans = std::make_shared<Transaction> (stpTrans, Validate::YES, reason);
|
||||
if (tpTrans->getStatus() != NEW)
|
||||
{
|
||||
jvResult[jss::error] = "invalidTransactions";
|
||||
jvResult[jss::error_exception] = "fails local checks";
|
||||
jvResult[jss::error] = "invalidTransaction";
|
||||
jvResult[jss::error_exception] = "fails local checks: " + reason;
|
||||
|
||||
return jvResult;
|
||||
}
|
||||
|
||||
@@ -485,17 +485,8 @@ transactionSign (
|
||||
|
||||
stpTrans->sign (keypair.secretKey);
|
||||
|
||||
Transaction::pointer tpTrans;
|
||||
|
||||
try
|
||||
{
|
||||
tpTrans = std::make_shared<Transaction> (stpTrans, Validate::NO);
|
||||
}
|
||||
catch (std::exception&)
|
||||
{
|
||||
return RPC::make_error (rpcINTERNAL,
|
||||
"Exception occurred during transaction");
|
||||
}
|
||||
Transaction::pointer tpTrans = std::make_shared<Transaction> (stpTrans,
|
||||
Validate::NO, reason);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user