{"record":{"id":"703fa478770a3343","repo":"phacility/phabricator","slug":"err-bad-phid","errorCode":"ERR-BAD-PHID","errorMessage":"ERR-BAD-PHID","messagePattern":"ERR-BAD-PHID","errorType":"error_code","errorClass":"ConduitException","httpStatus":null,"severity":"error","filePath":"src/applications/files/conduit/FileDownloadConduitAPIMethod.php","lineNumber":37,"sourceCode":"  protected function defineReturnType() {\n    return 'nonempty base64-bytes';\n  }\n\n  protected function defineErrorTypes() {\n    return array(\n      'ERR-BAD-PHID' => pht('No such file exists.'),\n    );\n  }\n\n  protected function execute(ConduitAPIRequest $request) {\n    $phid = $request->getValue('phid');\n\n    $file = id(new PhabricatorFileQuery())\n      ->setViewer($request->getUser())\n      ->withPHIDs(array($phid))\n      ->executeOne();\n    if (!$file) {\n      throw new ConduitException('ERR-BAD-PHID');\n    }\n\n    return base64_encode($file->loadFileData());\n  }\n\n}\n","sourceCodeStart":19,"sourceCodeEnd":44,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/conduit/FileDownloadConduitAPIMethod.php#L19-L44","documentation":"Error \"ERR-BAD-PHID\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/files/conduit/FileDownloadConduitAPIMethod.php:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}