diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a7273c0fc6..5110b19f2e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1524,6 +1524,7 @@ phutil_register_library_map(array( 'HarbormasterManagementUpdateWorkflow' => 'applications/harbormaster/management/HarbormasterManagementUpdateWorkflow.php', 'HarbormasterManagementWorkflow' => 'applications/harbormaster/management/HarbormasterManagementWorkflow.php', 'HarbormasterManagementWriteLogWorkflow' => 'applications/harbormaster/management/HarbormasterManagementWriteLogWorkflow.php', + 'HarbormasterMessageException' => 'applications/harbormaster/exception/HarbormasterMessageException.php', 'HarbormasterMessageType' => 'applications/harbormaster/engine/HarbormasterMessageType.php', 'HarbormasterObject' => 'applications/harbormaster/storage/HarbormasterObject.php', 'HarbormasterOtherBuildStepGroup' => 'applications/harbormaster/stepgroup/HarbormasterOtherBuildStepGroup.php', @@ -1541,7 +1542,6 @@ phutil_register_library_map(array( 'HarbormasterQueryBuildsConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterQueryBuildsConduitAPIMethod.php', 'HarbormasterQueryBuildsSearchEngineAttachment' => 'applications/harbormaster/engineextension/HarbormasterQueryBuildsSearchEngineAttachment.php', 'HarbormasterRemarkupRule' => 'applications/harbormaster/remarkup/HarbormasterRemarkupRule.php', - 'HarbormasterRestartException' => 'applications/harbormaster/exception/HarbormasterRestartException.php', 'HarbormasterRunBuildPlansHeraldAction' => 'applications/harbormaster/herald/HarbormasterRunBuildPlansHeraldAction.php', 'HarbormasterSchemaSpec' => 'applications/harbormaster/storage/HarbormasterSchemaSpec.php', 'HarbormasterScratchTable' => 'applications/harbormaster/storage/HarbormasterScratchTable.php', @@ -7784,6 +7784,7 @@ phutil_register_library_map(array( 'HarbormasterManagementUpdateWorkflow' => 'HarbormasterManagementWorkflow', 'HarbormasterManagementWorkflow' => 'PhabricatorManagementWorkflow', 'HarbormasterManagementWriteLogWorkflow' => 'HarbormasterManagementWorkflow', + 'HarbormasterMessageException' => 'Exception', 'HarbormasterMessageType' => 'Phobject', 'HarbormasterObject' => 'HarbormasterDAO', 'HarbormasterOtherBuildStepGroup' => 'HarbormasterBuildStepGroup', @@ -7801,7 +7802,6 @@ phutil_register_library_map(array( 'HarbormasterQueryBuildsConduitAPIMethod' => 'HarbormasterConduitAPIMethod', 'HarbormasterQueryBuildsSearchEngineAttachment' => 'PhabricatorSearchEngineAttachment', 'HarbormasterRemarkupRule' => 'PhabricatorObjectRemarkupRule', - 'HarbormasterRestartException' => 'Exception', 'HarbormasterRunBuildPlansHeraldAction' => 'HeraldAction', 'HarbormasterSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'HarbormasterScratchTable' => 'HarbormasterDAO', diff --git a/src/applications/harbormaster/controller/HarbormasterBuildActionController.php b/src/applications/harbormaster/controller/HarbormasterBuildActionController.php index d62fafeeb7..0156e485f1 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildActionController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildActionController.php @@ -41,7 +41,7 @@ final class HarbormasterBuildActionController try { $xaction->assertCanSendMessage($viewer, $build); - } catch (HarbormasterRestartException $ex) { + } catch (HarbormasterMessageException $ex) { return $this->newDialog() ->setTitle($ex->getTitle()) ->appendChild($ex->getBody()) diff --git a/src/applications/harbormaster/controller/HarbormasterBuildableActionController.php b/src/applications/harbormaster/controller/HarbormasterBuildableActionController.php index b0c74139db..1071870eda 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildableActionController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildableActionController.php @@ -43,7 +43,7 @@ final class HarbormasterBuildableActionController try { $message->assertCanSendMessage($viewer, $build); $can_send[$key] = $build; - } catch (HarbormasterRestartException $ex) { + } catch (HarbormasterMessageException $ex) { $exception = $ex; } diff --git a/src/applications/harbormaster/exception/HarbormasterRestartException.php b/src/applications/harbormaster/exception/HarbormasterMessageException.php similarity index 92% rename from src/applications/harbormaster/exception/HarbormasterRestartException.php rename to src/applications/harbormaster/exception/HarbormasterMessageException.php index 6516b52272..74213d47c4 100644 --- a/src/applications/harbormaster/exception/HarbormasterRestartException.php +++ b/src/applications/harbormaster/exception/HarbormasterMessageException.php @@ -1,6 +1,6 @@ assertCanSendMessage($viewer, $build); - } catch (HarbormasterRestartException $ex) { + } catch (HarbormasterMessageException $ex) { $this->logWarn( pht('INVALID'), $ex->newDisplayString()); diff --git a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php index eb47cc365c..2af5dc4048 100644 --- a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php +++ b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php @@ -88,14 +88,14 @@ final class HarbormasterBuildMessageAbortTransaction HarbormasterBuild $build) { if ($build->isAutobuild()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Abort Build'), pht( 'You can not abort a build that uses an autoplan.')); } if ($build->isComplete()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Abort Build'), pht( 'You can not abort this biuld because it is already complete.')); @@ -107,7 +107,7 @@ final class HarbormasterBuildMessageAbortTransaction HarbormasterBuild $build) { if ($build->isAborting()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Abort Build'), pht( 'You can not abort this build because it is already aborting.')); diff --git a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.php b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.php index b960632e0e..326970e63e 100644 --- a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.php +++ b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.php @@ -83,19 +83,19 @@ final class HarbormasterBuildMessagePauseTransaction HarbormasterBuild $build) { if ($build->isAutobuild()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Pause Build'), pht('You can not pause a build that uses an autoplan.')); } if ($build->isPaused()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Pause Build'), pht('You can not pause this build because it is already paused.')); } if ($build->isComplete()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Pause Build'), pht('You can not pause this build because it has already completed.')); } @@ -106,19 +106,19 @@ final class HarbormasterBuildMessagePauseTransaction HarbormasterBuild $build) { if ($build->isPausing()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Pause Build'), pht('You can not pause this build because it is already pausing.')); } if ($build->isRestarting()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Pause Build'), pht('You can not pause this build because it is already restarting.')); } if ($build->isAborting()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Pause Build'), pht('You can not pause this build because it is already aborting.')); } diff --git a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageRestartTransaction.php b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageRestartTransaction.php index d6af3acf26..6bc976dcea 100644 --- a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageRestartTransaction.php +++ b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageRestartTransaction.php @@ -105,7 +105,7 @@ final class HarbormasterBuildMessageRestartTransaction HarbormasterBuild $build) { if ($build->isAutobuild()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Can Not Restart Autobuild'), pht( 'This build can not be restarted because it is an automatic '. @@ -118,7 +118,7 @@ final class HarbormasterBuildMessageRestartTransaction // See T13526. Users who can't see the "BuildPlan" can end up here with // no object. This is highly questionable. if (!$plan) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('No Build Plan Permission'), pht( 'You can not restart this build because you do not have '. @@ -132,7 +132,7 @@ final class HarbormasterBuildMessageRestartTransaction $never_restartable = HarbormasterBuildPlanBehavior::RESTARTABLE_NEVER; $is_never = ($option_key === $never_restartable); if ($is_never) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Build Plan Prevents Restart'), pht( 'This build can not be restarted because the build plan is '. @@ -143,7 +143,7 @@ final class HarbormasterBuildMessageRestartTransaction $is_failed = ($option_key === $failed_restartable); if ($is_failed) { if (!$this->isFailed()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Only Restartable if Failed'), pht( 'This build can not be restarted because the build plan is '. @@ -159,7 +159,7 @@ final class HarbormasterBuildMessageRestartTransaction HarbormasterBuild $build) { if ($build->isRestarting()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Already Restarting'), pht( 'This build is already restarting. You can not reissue a restart '. diff --git a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageResumeTransaction.php b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageResumeTransaction.php index a4eb704d79..1bd7094799 100644 --- a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageResumeTransaction.php +++ b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageResumeTransaction.php @@ -75,14 +75,14 @@ final class HarbormasterBuildMessageResumeTransaction HarbormasterBuild $build) { if ($build->isAutobuild()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Resume Build'), pht( 'You can not resume a build that uses an autoplan.')); } if (!$build->isPaused() && !$build->isPausing()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Resume Build'), pht( 'You can not resume this build because it is not paused. You can '. @@ -96,20 +96,20 @@ final class HarbormasterBuildMessageResumeTransaction HarbormasterBuild $build) { if ($build->isResuming()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Resume Build'), pht( 'You can not resume this build beacuse it is already resuming.')); } if ($build->isRestarting()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Resume Build'), pht('You can not resume this build because it is already restarting.')); } if ($build->isAborting()) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Unable to Resume Build'), pht('You can not resume this build because it is already aborting.')); } diff --git a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageTransaction.php b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageTransaction.php index 723098d20b..22fa25a1fd 100644 --- a/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageTransaction.php +++ b/src/applications/harbormaster/xaction/build/HarbormasterBuildMessageTransaction.php @@ -86,7 +86,7 @@ abstract class HarbormasterBuildMessageTransaction try { $this->assertCanApplyMessage($viewer, $build); return true; - } catch (HarbormasterRestartException $ex) { + } catch (HarbormasterMessageException $ex) { return false; } } @@ -98,7 +98,7 @@ abstract class HarbormasterBuildMessageTransaction try { $this->assertCanSendMessage($viewer, $build); return true; - } catch (HarbormasterRestartException $ex) { + } catch (HarbormasterMessageException $ex) { return false; } } @@ -117,7 +117,7 @@ abstract class HarbormasterBuildMessageTransaction // See T13526. Users without permission to access the build plan can // currently end up here with no "BuildPlan" object. if (!$plan) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('No Build Plan Permission'), pht( 'You can not issue this command because you do not have '. @@ -133,7 +133,7 @@ abstract class HarbormasterBuildMessageTransaction $plan, PhabricatorPolicyCapability::CAN_EDIT); } catch (PhabricatorPolicyException $ex) { - throw new HarbormasterRestartException( + throw new HarbormasterMessageException( pht('Insufficent Build Plan Permission'), pht( 'The build plan for this build is configured to prevent '.