mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
STObject::applyTemplate() throws with description of error:
The `STObject` member function `setType()` has been renamed to applyTemplate() and modified to throw if there is a template mismatch. The error description in the exception is, in certain cases, used, to better indicate why a particular transaction was considered ill formed. Fixes #2585.
This commit is contained in:
committed by
Nik Bougalis
parent
c354809e1c
commit
ad5c5f1969
@@ -497,6 +497,10 @@ transactionPreProcessImpl (
|
||||
stpTrans = std::make_shared<STTx> (
|
||||
std::move (parsed.object.get()));
|
||||
}
|
||||
catch (STObject::FieldErr& err)
|
||||
{
|
||||
return RPC::make_error (rpcINVALID_PARAMS, err.what());
|
||||
}
|
||||
catch (std::exception&)
|
||||
{
|
||||
return RPC::make_error (rpcINTERNAL,
|
||||
@@ -1098,6 +1102,10 @@ Json::Value transactionSubmitMultiSigned (
|
||||
stpTrans = std::make_shared<STTx>(
|
||||
std::move(parsedTx_json.object.get()));
|
||||
}
|
||||
catch (STObject::FieldErr& err)
|
||||
{
|
||||
return RPC::make_error (rpcINVALID_PARAMS, err.what());
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
std::string reason (ex.what ());
|
||||
|
||||
Reference in New Issue
Block a user