{"record":{"id":"be7421857a75b8a7","repo":"phacility/phabricator","slug":"field-slug-must-be-non-empty-be7421","errorCode":null,"errorMessage":"Field \"slug\" must be non-empty.","messagePattern":"Field \"slug\" must be non-empty\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php","lineNumber":42,"sourceCode":"    return array(\n      'slug' => 'required string',\n    );\n  }\n\n  protected function defineReturnType() {\n    return 'nonempty dict';\n  }\n\n  protected function defineErrorTypes() {\n    return array(\n      'ERR-BAD-DOCUMENT' => pht('No such document exists.'),\n    );\n  }\n\n  protected function execute(ConduitAPIRequest $request) {\n    $slug = $request->getValue('slug');\n    if ($slug === null || !strlen($slug)) {\n      throw new Exception(pht('Field \"slug\" must be non-empty.'));\n    }\n\n    $document = id(new PhrictionDocumentQuery())\n      ->setViewer($request->getUser())\n      ->withSlugs(array(PhabricatorSlug::normalize($slug)))\n      ->needContent(true)\n      ->executeOne();\n    if (!$document) {\n      throw new ConduitException('ERR-BAD-DOCUMENT');\n    }\n\n    return $this->buildDocumentInfoDictionary($document);\n  }\n\n}\n","sourceCodeStart":24,"sourceCodeEnd":58,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php#L24-L58","documentation":"The phriction.info Conduit method requires the slug field to identify the document whose metadata will be returned; execute() rejects a null or zero-length slug up front. It is a plain Exception, so the client sees a generic Conduit failure.","triggerScenarios":"Calling conduit method phriction.info with slug omitted, null, or the empty string.","commonSituations":"Lookup helpers that accept whatever slug string the caller passed, including blanks; ingestion pipelines where a row's path field is empty.","solutions":["Pass a non-empty document slug in the call parameters","Guard the slug before the call when it originates from user input or external data","Log the offending parameter when the error occurs so the bad caller is identifiable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$slug = (string)idx($params, 'slug', '');\nif ($slug === '') {\n  throw new InvalidArgumentException('phriction.info: slug must be non-empty');\n}\n$result = $client->callMethodSynchronous('phriction.info', $params);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the slug parameter in shared conduit client wrappers","Treat empty slug input as a caller bug and fail fast","Log parameter maps for lookups sourced from external data"],"tags":["phabricator","phriction","conduit","slug","input-validation"],"backgroundTag":"required-field-empty","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}