{"record":{"id":"e5b05357a45dfd52","repo":"phacility/phabricator","slug":"this-is-an-explicit-exception","errorCode":null,"errorMessage":"(This is an explicit exception.)","messagePattern":"\\(This is an explicit exception\\.\\)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"info","filePath":"src/applications/harbormaster/step/HarbormasterThrowExceptionBuildStep.php","lineNumber":22,"sourceCode":"  extends HarbormasterBuildStepImplementation {\n\n  public function getName() {\n    return pht('Throw Exception');\n  }\n\n  public function getGenericDescription() {\n    return pht('Throw an exception.');\n  }\n\n  public function getBuildStepGroupKey() {\n    return HarbormasterTestBuildStepGroup::GROUPKEY;\n  }\n\n  public function execute(\n    HarbormasterBuild $build,\n    HarbormasterBuildTarget $build_target) {\n\n    throw new Exception(pht('(This is an explicit exception.)'));\n  }\n\n}\n","sourceCodeStart":4,"sourceCodeEnd":26,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/harbormaster/step/HarbormasterThrowExceptionBuildStep.php#L4-L26","documentation":"HarbormasterThrowExceptionBuildStep is a deliberate test/debug step (in the test build step group) whose execute() unconditionally throws this exception. It exists so administrators can exercise Harbormaster's failure handling: build targets failing, UI error states, and retry behavior. Seeing this error means a plan intentionally contains the 'Throw Exception' step.","triggerScenarios":"A build plan includes the 'Throw Exception' step (from the test/diagnostics group) and a build ran it. The exception is thrown on every execution, by design.","commonSituations":"Testing build failure notifications or UI; verifying how plans behave when a step fails; a leftover test step accidentally left in a production build plan.","solutions":["If this is production, edit the build plan and remove the 'Throw Exception' step.","If testing, treat the failure as expected and use it to validate retry/failure behavior."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Audit production plans for the test step before enabling them:\nforeach ($plan->getSteps() as $step) {\n  if ($step instanceof HarbormasterThrowExceptionBuildStep) {\n    // remove this step from production build plans\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep diagnostic steps out of production plans; review plan contents before enabling automation.","Name test plans clearly (e.g. prefix 'TEST -') so they are not copied into production."],"tags":["harbormaster","test","phabricator"],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}