mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +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:
parent
dbccfb234f
commit
573bf15124
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue