@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+29 -29
+2 -2
src/__phutil_library_map__.php
··· 1524 1524 'HarbormasterManagementUpdateWorkflow' => 'applications/harbormaster/management/HarbormasterManagementUpdateWorkflow.php', 1525 1525 'HarbormasterManagementWorkflow' => 'applications/harbormaster/management/HarbormasterManagementWorkflow.php', 1526 1526 'HarbormasterManagementWriteLogWorkflow' => 'applications/harbormaster/management/HarbormasterManagementWriteLogWorkflow.php', 1527 + 'HarbormasterMessageException' => 'applications/harbormaster/exception/HarbormasterMessageException.php', 1527 1528 'HarbormasterMessageType' => 'applications/harbormaster/engine/HarbormasterMessageType.php', 1528 1529 'HarbormasterObject' => 'applications/harbormaster/storage/HarbormasterObject.php', 1529 1530 'HarbormasterOtherBuildStepGroup' => 'applications/harbormaster/stepgroup/HarbormasterOtherBuildStepGroup.php', ··· 1541 1542 'HarbormasterQueryBuildsConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterQueryBuildsConduitAPIMethod.php', 1542 1543 'HarbormasterQueryBuildsSearchEngineAttachment' => 'applications/harbormaster/engineextension/HarbormasterQueryBuildsSearchEngineAttachment.php', 1543 1544 'HarbormasterRemarkupRule' => 'applications/harbormaster/remarkup/HarbormasterRemarkupRule.php', 1544 - 'HarbormasterRestartException' => 'applications/harbormaster/exception/HarbormasterRestartException.php', 1545 1545 'HarbormasterRunBuildPlansHeraldAction' => 'applications/harbormaster/herald/HarbormasterRunBuildPlansHeraldAction.php', 1546 1546 'HarbormasterSchemaSpec' => 'applications/harbormaster/storage/HarbormasterSchemaSpec.php', 1547 1547 'HarbormasterScratchTable' => 'applications/harbormaster/storage/HarbormasterScratchTable.php', ··· 7784 7784 'HarbormasterManagementUpdateWorkflow' => 'HarbormasterManagementWorkflow', 7785 7785 'HarbormasterManagementWorkflow' => 'PhabricatorManagementWorkflow', 7786 7786 'HarbormasterManagementWriteLogWorkflow' => 'HarbormasterManagementWorkflow', 7787 + 'HarbormasterMessageException' => 'Exception', 7787 7788 'HarbormasterMessageType' => 'Phobject', 7788 7789 'HarbormasterObject' => 'HarbormasterDAO', 7789 7790 'HarbormasterOtherBuildStepGroup' => 'HarbormasterBuildStepGroup', ··· 7801 7802 'HarbormasterQueryBuildsConduitAPIMethod' => 'HarbormasterConduitAPIMethod', 7802 7803 'HarbormasterQueryBuildsSearchEngineAttachment' => 'PhabricatorSearchEngineAttachment', 7803 7804 'HarbormasterRemarkupRule' => 'PhabricatorObjectRemarkupRule', 7804 - 'HarbormasterRestartException' => 'Exception', 7805 7805 'HarbormasterRunBuildPlansHeraldAction' => 'HeraldAction', 7806 7806 'HarbormasterSchemaSpec' => 'PhabricatorConfigSchemaSpec', 7807 7807 'HarbormasterScratchTable' => 'HarbormasterDAO',
+1 -1
src/applications/harbormaster/controller/HarbormasterBuildActionController.php
··· 41 41 42 42 try { 43 43 $xaction->assertCanSendMessage($viewer, $build); 44 - } catch (HarbormasterRestartException $ex) { 44 + } catch (HarbormasterMessageException $ex) { 45 45 return $this->newDialog() 46 46 ->setTitle($ex->getTitle()) 47 47 ->appendChild($ex->getBody())
+1 -1
src/applications/harbormaster/controller/HarbormasterBuildableActionController.php
··· 43 43 try { 44 44 $message->assertCanSendMessage($viewer, $build); 45 45 $can_send[$key] = $build; 46 - } catch (HarbormasterRestartException $ex) { 46 + } catch (HarbormasterMessageException $ex) { 47 47 $exception = $ex; 48 48 } 49 49
+1 -1
src/applications/harbormaster/exception/HarbormasterRestartException.php src/applications/harbormaster/exception/HarbormasterMessageException.php
··· 1 1 <?php 2 2 3 - final class HarbormasterRestartException extends Exception { 3 + final class HarbormasterMessageException extends Exception { 4 4 5 5 private $title; 6 6 private $body = array();
+1 -1
src/applications/harbormaster/management/HarbormasterManagementRestartWorkflow.php
··· 70 70 71 71 try { 72 72 $message->assertCanSendMessage($viewer, $build); 73 - } catch (HarbormasterRestartException $ex) { 73 + } catch (HarbormasterMessageException $ex) { 74 74 $this->logWarn( 75 75 pht('INVALID'), 76 76 $ex->newDisplayString());
+3 -3
src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php
··· 88 88 HarbormasterBuild $build) { 89 89 90 90 if ($build->isAutobuild()) { 91 - throw new HarbormasterRestartException( 91 + throw new HarbormasterMessageException( 92 92 pht('Unable to Abort Build'), 93 93 pht( 94 94 'You can not abort a build that uses an autoplan.')); 95 95 } 96 96 97 97 if ($build->isComplete()) { 98 - throw new HarbormasterRestartException( 98 + throw new HarbormasterMessageException( 99 99 pht('Unable to Abort Build'), 100 100 pht( 101 101 'You can not abort this biuld because it is already complete.')); ··· 107 107 HarbormasterBuild $build) { 108 108 109 109 if ($build->isAborting()) { 110 - throw new HarbormasterRestartException( 110 + throw new HarbormasterMessageException( 111 111 pht('Unable to Abort Build'), 112 112 pht( 113 113 'You can not abort this build because it is already aborting.'));
+6 -6
src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.php
··· 83 83 HarbormasterBuild $build) { 84 84 85 85 if ($build->isAutobuild()) { 86 - throw new HarbormasterRestartException( 86 + throw new HarbormasterMessageException( 87 87 pht('Unable to Pause Build'), 88 88 pht('You can not pause a build that uses an autoplan.')); 89 89 } 90 90 91 91 if ($build->isPaused()) { 92 - throw new HarbormasterRestartException( 92 + throw new HarbormasterMessageException( 93 93 pht('Unable to Pause Build'), 94 94 pht('You can not pause this build because it is already paused.')); 95 95 } 96 96 97 97 if ($build->isComplete()) { 98 - throw new HarbormasterRestartException( 98 + throw new HarbormasterMessageException( 99 99 pht('Unable to Pause Build'), 100 100 pht('You can not pause this build because it has already completed.')); 101 101 } ··· 106 106 HarbormasterBuild $build) { 107 107 108 108 if ($build->isPausing()) { 109 - throw new HarbormasterRestartException( 109 + throw new HarbormasterMessageException( 110 110 pht('Unable to Pause Build'), 111 111 pht('You can not pause this build because it is already pausing.')); 112 112 } 113 113 114 114 if ($build->isRestarting()) { 115 - throw new HarbormasterRestartException( 115 + throw new HarbormasterMessageException( 116 116 pht('Unable to Pause Build'), 117 117 pht('You can not pause this build because it is already restarting.')); 118 118 } 119 119 120 120 if ($build->isAborting()) { 121 - throw new HarbormasterRestartException( 121 + throw new HarbormasterMessageException( 122 122 pht('Unable to Pause Build'), 123 123 pht('You can not pause this build because it is already aborting.')); 124 124 }
+5 -5
src/applications/harbormaster/xaction/build/HarbormasterBuildMessageRestartTransaction.php
··· 105 105 HarbormasterBuild $build) { 106 106 107 107 if ($build->isAutobuild()) { 108 - throw new HarbormasterRestartException( 108 + throw new HarbormasterMessageException( 109 109 pht('Can Not Restart Autobuild'), 110 110 pht( 111 111 'This build can not be restarted because it is an automatic '. ··· 118 118 // See T13526. Users who can't see the "BuildPlan" can end up here with 119 119 // no object. This is highly questionable. 120 120 if (!$plan) { 121 - throw new HarbormasterRestartException( 121 + throw new HarbormasterMessageException( 122 122 pht('No Build Plan Permission'), 123 123 pht( 124 124 'You can not restart this build because you do not have '. ··· 132 132 $never_restartable = HarbormasterBuildPlanBehavior::RESTARTABLE_NEVER; 133 133 $is_never = ($option_key === $never_restartable); 134 134 if ($is_never) { 135 - throw new HarbormasterRestartException( 135 + throw new HarbormasterMessageException( 136 136 pht('Build Plan Prevents Restart'), 137 137 pht( 138 138 'This build can not be restarted because the build plan is '. ··· 143 143 $is_failed = ($option_key === $failed_restartable); 144 144 if ($is_failed) { 145 145 if (!$this->isFailed()) { 146 - throw new HarbormasterRestartException( 146 + throw new HarbormasterMessageException( 147 147 pht('Only Restartable if Failed'), 148 148 pht( 149 149 'This build can not be restarted because the build plan is '. ··· 159 159 HarbormasterBuild $build) { 160 160 161 161 if ($build->isRestarting()) { 162 - throw new HarbormasterRestartException( 162 + throw new HarbormasterMessageException( 163 163 pht('Already Restarting'), 164 164 pht( 165 165 'This build is already restarting. You can not reissue a restart '.
+5 -5
src/applications/harbormaster/xaction/build/HarbormasterBuildMessageResumeTransaction.php
··· 75 75 HarbormasterBuild $build) { 76 76 77 77 if ($build->isAutobuild()) { 78 - throw new HarbormasterRestartException( 78 + throw new HarbormasterMessageException( 79 79 pht('Unable to Resume Build'), 80 80 pht( 81 81 'You can not resume a build that uses an autoplan.')); 82 82 } 83 83 84 84 if (!$build->isPaused() && !$build->isPausing()) { 85 - throw new HarbormasterRestartException( 85 + throw new HarbormasterMessageException( 86 86 pht('Unable to Resume Build'), 87 87 pht( 88 88 'You can not resume this build because it is not paused. You can '. ··· 96 96 HarbormasterBuild $build) { 97 97 98 98 if ($build->isResuming()) { 99 - throw new HarbormasterRestartException( 99 + throw new HarbormasterMessageException( 100 100 pht('Unable to Resume Build'), 101 101 pht( 102 102 'You can not resume this build beacuse it is already resuming.')); 103 103 } 104 104 105 105 if ($build->isRestarting()) { 106 - throw new HarbormasterRestartException( 106 + throw new HarbormasterMessageException( 107 107 pht('Unable to Resume Build'), 108 108 pht('You can not resume this build because it is already restarting.')); 109 109 } 110 110 111 111 if ($build->isAborting()) { 112 - throw new HarbormasterRestartException( 112 + throw new HarbormasterMessageException( 113 113 pht('Unable to Resume Build'), 114 114 pht('You can not resume this build because it is already aborting.')); 115 115 }
+4 -4
src/applications/harbormaster/xaction/build/HarbormasterBuildMessageTransaction.php
··· 86 86 try { 87 87 $this->assertCanApplyMessage($viewer, $build); 88 88 return true; 89 - } catch (HarbormasterRestartException $ex) { 89 + } catch (HarbormasterMessageException $ex) { 90 90 return false; 91 91 } 92 92 } ··· 98 98 try { 99 99 $this->assertCanSendMessage($viewer, $build); 100 100 return true; 101 - } catch (HarbormasterRestartException $ex) { 101 + } catch (HarbormasterMessageException $ex) { 102 102 return false; 103 103 } 104 104 } ··· 117 117 // See T13526. Users without permission to access the build plan can 118 118 // currently end up here with no "BuildPlan" object. 119 119 if (!$plan) { 120 - throw new HarbormasterRestartException( 120 + throw new HarbormasterMessageException( 121 121 pht('No Build Plan Permission'), 122 122 pht( 123 123 'You can not issue this command because you do not have '. ··· 133 133 $plan, 134 134 PhabricatorPolicyCapability::CAN_EDIT); 135 135 } catch (PhabricatorPolicyException $ex) { 136 - throw new HarbormasterRestartException( 136 + throw new HarbormasterMessageException( 137 137 pht('Insufficent Build Plan Permission'), 138 138 pht( 139 139 'The build plan for this build is configured to prevent '.