{"record":{"id":"7d6c84ec8f3c5a42","repo":"zed-industries/zed","slug":"failed-to-get-authenticated-user-status-bod","errorCode":null,"errorMessage":"Failed to get authenticated user.\nStatus: {:?}\nBody: {body}","messagePattern":"Failed to get authenticated user\\.\nStatus: (.+?)\nBody: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cloud_api_client/src/cloud_api_client.rs","lineNumber":264,"sourceCode":"            ),\n            AsyncBody::default(),\n            Some(&Credentials {\n                user_id,\n                access_token: access_token.into(),\n            }),\n        )?;\n\n        let mut response = self.http_client.send(request).await?;\n\n        if response.status().is_success() {\n            Ok(true)\n        } else {\n            let mut body = String::new();\n            response.body_mut().read_to_string(&mut body).await?;\n            if response.status() == StatusCode::UNAUTHORIZED {\n                Ok(false)\n            } else {\n                Err(anyhow!(\n                    \"Failed to get authenticated user.\\nStatus: {:?}\\nBody: {body}\",\n                    response.status()\n                ))\n            }\n        }\n    }\n\n    pub async fn submit_agent_feedback(&self, body: SubmitAgentThreadFeedbackBody) -> Result<()> {\n        let request = Request::builder().method(Method::POST).uri(\n            self.http_client\n                .build_zed_cloud_url(\"/client/feedback/agent_thread\")?\n                .as_ref(),\n        );\n\n        self.send_authenticated_request(request, AsyncBody::from(serde_json::to_string(&body)?))\n            .await?;\n        Ok(())\n    }","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/cloud_api_client/src/cloud_api_client.rs#L246-L282","documentation":"validate_credentials sent the authenticated user request with the supplied user_id/access_token and got a non-success, non-401 response; the status and body are embedded, meaning the check could not distinguish valid from invalid credentials because the server itself errored (5xx, rate limit, or gateway issue) rather than rejecting the token.","triggerScenarios":"Thrown at crates/cloud_api_client/src/cloud_api_client.rs:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry validation after a backoff for transient server errors","Inspect the embedded status/body to identify gateway or rate-limit issues","Treat only 401 as invalid credentials; surface other statuses as connectivity problems"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}