{"record":{"id":"86204163d466bdee","repo":"phacility/phabricator","slug":"user-does-not-own-email","errorCode":null,"errorMessage":"User does not own email!","messagePattern":"User does not own email!","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/people/editor/PhabricatorUserEditor.php","lineNumber":287,"sourceCode":"    PhabricatorUser $user,\n    PhabricatorUserEmail $email) {\n    $actor = $this->requireActor();\n\n    if (!$user->getID()) {\n      throw new Exception(pht('User has not been created yet!'));\n    }\n    if (!$email->getID()) {\n      throw new Exception(pht('Email has not been created yet!'));\n    }\n\n    $user->openTransaction();\n      $user->beginWriteLocking();\n\n        $user->reload();\n        $email->reload();\n\n        if ($email->getUserPHID() != $user->getPHID()) {\n          throw new Exception(pht('User does not own email!'));\n        }\n\n        if ($email->getIsPrimary()) {\n          throw new Exception(pht('Email is already primary!'));\n        }\n\n        if (!$email->getIsVerified()) {\n          throw new Exception(pht('Email is not verified!'));\n        }\n\n        $old_primary = $user->loadPrimaryEmail();\n        if ($old_primary) {\n          $old_primary->setIsPrimary(0);\n          $old_primary->save();\n        }\n\n        $email->setIsPrimary(1);\n        $email->save();","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/people/editor/PhabricatorUserEditor.php#L269-L305","documentation":"Error \"User does not own email!\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/people/editor/PhabricatorUserEditor.php:287 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"}