diff --git a/src/applications/diffusion/herald/HeraldPreCommitAdapter.php b/src/applications/diffusion/herald/HeraldPreCommitAdapter.php index 15832a08eb..61bcef4c33 100644 --- a/src/applications/diffusion/herald/HeraldPreCommitAdapter.php +++ b/src/applications/diffusion/herald/HeraldPreCommitAdapter.php @@ -72,16 +72,20 @@ abstract class HeraldPreCommitAdapter extends HeraldAdapter { switch ($rule_type) { case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL: case HeraldRuleTypeConfig::RULE_TYPE_OBJECT: - return array( - self::ACTION_BLOCK, - self::ACTION_EMAIL, - self::ACTION_NOTHING - ); + return array_merge( + array( + self::ACTION_BLOCK, + self::ACTION_EMAIL, + self::ACTION_NOTHING, + ), + parent::getActions($rule_type)); case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL: - return array( - self::ACTION_EMAIL, - self::ACTION_NOTHING, - ); + return array_merge( + array( + self::ACTION_EMAIL, + self::ACTION_NOTHING, + ), + parent::getActions($rule_type)); } } @@ -118,7 +122,15 @@ abstract class HeraldPreCommitAdapter extends HeraldAdapter { pht('Blocked push.')); break; default: - throw new Exception(pht('No rules to handle action "%s"!', $action)); + $custom_result = parent::handleCustomHeraldEffect($effect); + if ($custom_result === null) { + throw new Exception(pht( + "No rules to handle action '%s'.", + $action)); + } + + $result[] = $custom_result; + break; } } diff --git a/src/applications/herald/adapter/HeraldCommitAdapter.php b/src/applications/herald/adapter/HeraldCommitAdapter.php index 90b3c91552..c749d835a1 100644 --- a/src/applications/herald/adapter/HeraldCommitAdapter.php +++ b/src/applications/herald/adapter/HeraldCommitAdapter.php @@ -544,7 +544,9 @@ final class HeraldCommitAdapter extends HeraldAdapter { default: $custom_result = parent::handleCustomHeraldEffect($effect); if ($custom_result === null) { - throw new Exception("No rules to handle action '{$action}'."); + throw new Exception(pht( + "No rules to handle action '%s'.", + $action)); } $result[] = $custom_result; diff --git a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php index ef436894b7..477d38bad5 100644 --- a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php +++ b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php @@ -422,7 +422,9 @@ final class HeraldDifferentialRevisionAdapter default: $custom_result = parent::handleCustomHeraldEffect($effect); if ($custom_result === null) { - throw new Exception("No rules to handle action '{$action}'."); + throw new Exception(pht( + "No rules to handle action '%s'.", + $action)); } $result[] = $custom_result; diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php index 4376b2aded..ac0bbcad93 100644 --- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php +++ b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php @@ -207,7 +207,9 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter { default: $custom_result = parent::handleCustomHeraldEffect($effect); if ($custom_result === null) { - throw new Exception("No rules to handle action '{$action}'."); + throw new Exception(pht( + "No rules to handle action '%s'.", + $action)); } $result[] = $custom_result; diff --git a/src/applications/herald/adapter/HeraldPholioMockAdapter.php b/src/applications/herald/adapter/HeraldPholioMockAdapter.php index 918e66e321..3752a733f3 100644 --- a/src/applications/herald/adapter/HeraldPholioMockAdapter.php +++ b/src/applications/herald/adapter/HeraldPholioMockAdapter.php @@ -139,7 +139,9 @@ final class HeraldPholioMockAdapter extends HeraldAdapter { default: $custom_result = parent::handleCustomHeraldEffect($effect); if ($custom_result === null) { - throw new Exception("No rules to handle action '{$action}'."); + throw new Exception(pht( + "No rules to handle action '%s'.", + $action)); } $result[] = $custom_result;