1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 17:52:43 +01:00

Log Herald rules with invalid keys via phlog()

Summary:
When Herald rules fail unexpectedly due to relying on a (now) invalid key, allow Phorge administrators to get aware by creating an entry in the error log via `phlog()` instead of crossing fingers that someone may from time to time get the idea to open and read Herald transcripts.

Refs T15885

Test Plan: See steps in T15885; check error log.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15885

Differential Revision: https://we.phorge.it/D25735
This commit is contained in:
Andre Klapper 2024-07-19 15:28:07 +02:00
parent 93c9afd2f3
commit f6302c7ee3

View file

@ -532,8 +532,12 @@ final class HeraldEngine extends Phobject {
if ($caught) { if ($caught) {
$result_data = array( $result_data = array(
'exception.class' => get_class($caught), 'exception.class' => get_class($caught),
'exception.message' => $ex->getMessage(), 'exception.message' => $caught->getMessage(),
); );
phlog(pht('An exception occurred executing Herald rule %s: "%s" Review '.
'the Herald transcripts and correct or disable the problematic rule.',
$rule->getMonogram(),
$caught->getMessage()));
} }
$result = HeraldConditionResult::newFromResultCode($result_code) $result = HeraldConditionResult::newFromResultCode($result_code)