mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
fix(test): handle null metadata for unvalidated tx in Env::meta (#5715)
This change handles errors better when calling `env.meta`. It prints some debug help and throws an error if `env.meta` is going to return a `nullptr`.
This commit is contained in:
@@ -499,7 +499,16 @@ Env::meta()
|
||||
close();
|
||||
}
|
||||
auto const item = closed()->txRead(txid_);
|
||||
return item.second;
|
||||
auto const result = item.second;
|
||||
if (result == nullptr)
|
||||
{
|
||||
test.log << "Env::meta: no metadata for txid: " << txid_ << std::endl;
|
||||
test.log << "This is probably because the transaction failed with a "
|
||||
"non-tec error."
|
||||
<< std::endl;
|
||||
Throw<std::runtime_error>("Env::meta: no metadata for txid");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::shared_ptr<STTx const>
|
||||
|
||||
Reference in New Issue
Block a user