{"record":{"id":"a5d657195d4da601","repo":"phacility/phabricator","slug":"validation-getmessage","errorCode":null,"errorMessage":"$validation->getMessage()","messagePattern":"\\$validation->getMessage\\(\\)","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php","lineNumber":127,"sourceCode":"          break;\n      }\n    }\n\n    $use_database = $args->getArg('database');\n    if ($option->getLocked() && $use_database) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Config key \"%s\" is locked and can only be set in local '.\n          'configuration. To learn more, see \"%s\" in the documentation.',\n          $key,\n          pht('Configuration Guide: Locked and Hidden Configuration')));\n    }\n\n    try {\n      $option->getGroup()->validateOption($option, $value);\n    } catch (PhabricatorConfigValidationException $validation) {\n      // Convert this into a usage exception so we don't dump a stack trace.\n      throw new PhutilArgumentUsageException($validation->getMessage());\n    }\n\n    if ($use_database) {\n      $config_entry = PhabricatorConfigEntry::loadConfigEntry($key);\n      $config_entry->setValue($value);\n\n      // If the entry has been deleted, resurrect it.\n      $config_entry->setIsDeleted(0);\n\n      $config_entry->save();\n\n      $write_message = pht(\n        'Wrote configuration key \"%s\" to database storage.',\n        $key);\n    } else {\n      $config_source = new PhabricatorConfigLocalSource();\n\n      $local_path = $config_source->getReadablePath();","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php#L109-L145","documentation":"Error \"$validation->getMessage()\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php:127 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"}