mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-28 17:40:10 +00:00
Add logging for exceptions: (#4400)
Log exception messages at several locations. Previously, these were locations where an exception was caught, but the exception message was not logged. Logging the exception messages can be useful for analysis or debugging. The additional logging could have a small negative performance impact. Fix #3213.
This commit is contained in:
@@ -1608,10 +1608,11 @@ PeerImp::handleTransaction(
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (std::exception const&)
|
||||
catch (std::exception const& ex)
|
||||
{
|
||||
JLOG(p_journal_.warn())
|
||||
<< "Transaction invalid: " << strHex(m->rawtransaction());
|
||||
<< "Transaction invalid: " << strHex(m->rawtransaction())
|
||||
<< ". Exception: " << ex.what();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3110,8 +3111,10 @@ PeerImp::checkTransaction(
|
||||
app_.getOPs().processTransaction(
|
||||
tx, trusted, false, NetworkOPs::FailHard::no);
|
||||
}
|
||||
catch (std::exception const&)
|
||||
catch (std::exception const& ex)
|
||||
{
|
||||
JLOG(p_journal_.warn())
|
||||
<< "Exception in " << __func__ << ": " << ex.what();
|
||||
app_.getHashRouter().setFlags(stx->getTransactionID(), SF_BAD);
|
||||
charge(Resource::feeBadData);
|
||||
}
|
||||
@@ -3195,9 +3198,10 @@ PeerImp::checkValidation(
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception const&)
|
||||
catch (std::exception const& ex)
|
||||
{
|
||||
JLOG(p_journal_.trace()) << "Exception processing validation";
|
||||
JLOG(p_journal_.trace())
|
||||
<< "Exception processing validation: " << ex.what();
|
||||
charge(Resource::feeInvalidRequest);
|
||||
}
|
||||
}
|
||||
@@ -3566,7 +3570,7 @@ PeerImp::processLedgerRequest(std::shared_ptr<protocol::TMGetLedger> const& m)
|
||||
<< "processLedgerRequest: getNodeFat returns false";
|
||||
}
|
||||
}
|
||||
catch (std::exception& e)
|
||||
catch (std::exception const& e)
|
||||
{
|
||||
std::string info;
|
||||
switch (itype)
|
||||
|
||||
Reference in New Issue
Block a user