1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

Log Herald rules with invalid actions via phlog()

Summary:
When Herald rules fail unexpectedly due to relying on a (now) invalid action, 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 T15887

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

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15887

Differential Revision: https://we.phorge.it/D25737
This commit is contained in:
Andre Klapper 2024-07-22 13:38:32 +02:00
parent 71615f4b99
commit 0bfe9ca88f

View file

@ -688,6 +688,14 @@ final class HeraldEngine extends Phobject {
->setTarget($action->getTarget()) ->setTarget($action->getTarget())
->setRule($rule); ->setRule($rule);
if ($object->getActionImplementation($action->getAction()) === null) {
phlog(pht('An exception occurred executing Herald rule %s: Unknown '.
'action: "%s". Review the Herald transcripts and correct or '.
'disable the problematic rule.',
$rule->getMonogram(),
$action->getAction()));
}
$name = $rule->getName(); $name = $rule->getName();
$id = $rule->getID(); $id = $rule->getID();
$effect->setReason( $effect->setReason(