1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Provide a more tailored error message when a Herald rule fails because of PCRE limits

Summary: Ref T13100. Since rules may begin failing for PRCE configuration reasons soon, provide a more complete explanation of possible causes in the UI.

Test Plan: Faked this, hit it via test console, saw explanation in web UI.

Maniphest Tasks: T13100

Differential Revision: https://secure.phabricator.com/D19178
This commit is contained in:
epriestley 2018-03-06 12:12:53 -08:00
parent dbccfb234f
commit 573bf15124

View file

@ -490,7 +490,13 @@ abstract class HeraldAdapter extends Phobject {
$result = @preg_match($condition_value.'S', $value);
if ($result === false) {
throw new HeraldInvalidConditionException(
pht('Regular expression is not valid!'));
pht(
'Regular expression "%s" in Herald rule "%s" is not valid, '.
'or exceeded backtracking or recursion limits while '.
'executing. Verify the expression and correct it or rewrite '.
'it with less backtracking.',
$condition_value,
$rule->getMonogram()));
}
if ($result) {
return $result_if_match;