{"record":{"id":"87e625ad0e4dd5f8","repo":"atuinsh/atuin","slug":"unknown-error-87e625","errorCode":null,"errorMessage":"unknown error","messagePattern":"unknown error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-client/src/auth.rs","lineNumber":211,"sourceCode":"        let resp = client\n            .patch(url)\n            .json(&ChangePasswordRequest {\n                current_password: current_password.to_string(),\n                new_password: new_password.to_string(),\n            })\n            .send()\n            .await?;\n\n        match resp.status().as_u16() {\n            200 => Ok(MutateResponse::Success),\n            401 => {\n                bail!(\"current password is incorrect\");\n            }\n            403 => {\n                bail!(\"invalid login details\");\n            }\n            _ => {\n                bail!(\"unknown error\");\n            }\n        }\n    }\n\n    async fn delete_account(\n        &self,\n        password: &str,\n        _totp_code: Option<&str>,\n    ) -> Result<MutateResponse> {\n        let client = self.authenticated_client()?;\n        let url = self.address.append([\"account\"])?;\n\n        let resp =\n            client.delete(url).json(&serde_json::json!({ \"password\": password })).send().await?;\n\n        match resp.status().as_u16() {\n            200 => Ok(MutateResponse::Success),\n            401 => {","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin-client/src/auth.rs#L193-L229","documentation":"Generic catch-all in `change_password` for any HTTP status other than 200/401/403. The library has no specific mapping, so any other server response — client error, rate limit, or server failure — surfaces as this opaque bail. It hides the real status code from the caller.","triggerScenarios":"The `PATCH account/password` endpoint returns 400 (validation rejected the new password), 404 (wrong/legacy server route), 409, 429 (rate limited), or any 5xx; also proxies returning HTML error pages.","commonSituations":"New password violating server-side policy (400); outdated self-hosted server lacking the endpoint (404); server outage or load balancer 502/503; rate limiting after multiple failed attempts.","solutions":["Reproduce with curl against `<sync_address>/account/password` to see the real status and body","Check the new password meets the server's requirements if the status is 400","Confirm server version compatibility and upgrade self-hosted Atuin server if the route is missing","Retry with backoff for 429/5xx responses after checking server health/logs"],"exampleFix":"// before\n_ => bail!(\"unknown error\"),\n// after\n_ => {\n    let status = resp.status();\n    let body = resp.text().await.unwrap_or_default();\n    bail!(\"password change failed: {status} {body}\");\n}","handlingStrategy":"retry","validationCode":"// Pre-flight: confirm the password endpoint exists on this server\nlet probe = reqwest::Client::new()\n    .patch(format!(\"{sync_address}/account/password\"))\n    .send().await?;\nif probe.status() == reqwest::StatusCode::NOT_FOUND {\n    bail!(\"server does not expose /account/password; upgrade server\");\n}","typeGuard":null,"tryCatchPattern":"match auth_client.change_password(current, new, totp).await {\n    Ok(MutateResponse::Success) => println!(\"ok\"),\n    Err(e) if e.to_string() == \"unknown error\" => {\n        // status unmapped: inspect server, back off, retry\n        tokio::time::sleep(Duration::from_secs(5)).await;\n        // retry once, then surface diagnostics\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Upgrade self-hosted servers before using newer CLI account features","Enforce new-password policy client-side to avoid 400 validation failures","Back off and retry on 429/5xx instead of hammering the endpoint","Monitor server/proxy logs when account operations fail opaquely"],"tags":["http","atuin","sync-server","error-handling"],"backgroundTag":"http-error-response","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}