mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 14:51:06 +01:00
(stable) 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
9356a993a8
commit
b52783af80
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);
|
$result = @preg_match($condition_value.'S', $value);
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
throw new HeraldInvalidConditionException(
|
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) {
|
if ($result) {
|
||||||
return $result_if_match;
|
return $result_if_match;
|
||||||
|
|
Loading…
Reference in a new issue