1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

Rename "HarbormasterRestartException" to "HarbormasterMessageException"

Summary: Ref T13072. This exception is now raised by all of the message-sending code. Pretty straight find/replace.

Test Plan: Grepped for old class name, no hits.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21699
This commit is contained in:
epriestley 2021-07-20 14:42:40 -07:00
parent 4c4123f98b
commit 4cffaa600b
10 changed files with 29 additions and 29 deletions

View file

@ -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',

View file

@ -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())

View file

@ -43,7 +43,7 @@ final class HarbormasterBuildableActionController
try {
$message->assertCanSendMessage($viewer, $build);
$can_send[$key] = $build;
} catch (HarbormasterRestartException $ex) {
} catch (HarbormasterMessageException $ex) {
$exception = $ex;
}

View file

@ -1,6 +1,6 @@
<?php
final class HarbormasterRestartException extends Exception {
final class HarbormasterMessageException extends Exception {
private $title;
private $body = array();

View file

@ -70,7 +70,7 @@ final class HarbormasterManagementRestartWorkflow
try {
$message->assertCanSendMessage($viewer, $build);
} catch (HarbormasterRestartException $ex) {
} catch (HarbormasterMessageException $ex) {
$this->logWarn(
pht('INVALID'),
$ex->newDisplayString());

View file

@ -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.'));

View file

@ -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.'));
}

View file

@ -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 '.

View file

@ -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.'));
}

View file

@ -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 '.