{"record":{"id":"c0f0dbdc1b7efb16","repo":"tonhowtf/omniget","slug":"fxtwitter","errorCode":null,"errorMessage":"FxTwitter: {} ({})","messagePattern":"FxTwitter: (.+?) \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/x/fx.rs","lineNumber":67,"sourceCode":"        .and_then(|c| c.as_u64())\n        .unwrap_or(status.as_u16() as u64);\n    if code == 404 {\n        return Err(anyhow!(\"nao encontrado no X (ou o post e privado)\"));\n    }\n    if code == 401 {\n        return Err(anyhow!(\"post ou perfil privado\"));\n    }\n    if code == 429 {\n        return Err(anyhow!(\n            \"FxTwitter: limite de requisicoes atingido, tente de novo em instantes\"\n        ));\n    }\n    if code >= 400 {\n        let msg = body\n            .get(\"message\")\n            .and_then(|m| m.as_str())\n            .unwrap_or(\"erro\");\n        return Err(anyhow!(\"FxTwitter: {} ({})\", msg, code));\n    }\n    Ok(body)\n}\n\nfn s(v: &Value, k: &str) -> String {\n    v.get(k).and_then(|x| x.as_str()).unwrap_or(\"\").to_string()\n}\n\nfn n(v: &Value, k: &str) -> u64 {\n    v.get(k)\n        .and_then(|x| x.as_u64().or_else(|| x.as_f64().map(|f| f.max(0.0) as u64)))\n        .unwrap_or(0)\n}\n\npub fn user_from(v: &Value) -> XUser {\n    XUser {\n        id: s(v, \"id\"),\n        handle: s(v, \"screen_name\"),","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/x/fx.rs#L49-L85","documentation":"Catch-all for any FxTwitter response with code >= 400 not covered by the 404/401/429 branches. The error embeds FxTwitter's own message field and numeric code, e.g. upstream 5xx errors, 403 blocks, or unknown API errors.","triggerScenarios":"FxTwitter returns any other client/server error (500, 502, 503, 403, 400) during status, thread, conversation, profile, profile_statuses or profile_media calls — either from FxTwitter itself or propagated from X's API.","commonSituations":"FxTwitter or X backend outage (5xx); bad request due to malformed input the earlier checks missed; content blocked by X moderation; FxTwitter API version change producing new error codes.","solutions":["Read the embedded code and message: retry for 5xx with backoff, fix input for 4xx.","Log the full body alongside the code for diagnosis of new/unmapped error codes.","Check FxTwitter's status or repository for known incidents or API changes.","Fall back to the native authenticated X client for persistent upstream failures."],"exampleFix":"null","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match fx::status(&id).await {\n    Ok(p) => p,\n    Err(e) if e.to_string().contains(\"FxTwitter: \") => {\n        // embedded code decides: retry 5xx, fail fast 4xx\n        if let Some(code) = extract_code(&e) {\n            if code >= 500 { retry_with_backoff(|| fx::status(&id)).await }\n            else { Err(e) }\n        } else { Err(e) }\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Log the full response body whenever an unmapped code appears","Retry only 5xx-family codes with backoff; fail fast on 4xx","Monitor FxTwitter status/incidents for recurring upstream failures","Keep the native X client ready as a fallback for sustained outages"],"tags":["fxtwitter","http-error","upstream","x"],"backgroundTag":"upstream-api-error","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}