{"record":{"id":"2b02afac896a443b","repo":"tonhowtf/omniget","slug":"nao-encontrado-no-x-ou-o-post-e-privado","errorCode":null,"errorMessage":"nao encontrado no X (ou o post e privado)","messagePattern":"nao encontrado no X \\(ou o post e privado\\)","errorType":"exception","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"src-tauri/omniget-core/src/core/tools/x/fx.rs","lineNumber":52,"sourceCode":"        .iter()\n        .filter(|(_, v)| !v.is_empty())\n        .map(|(k, v)| (*k, v.as_str()))\n        .collect();\n    if !q.is_empty() {\n        req = req.query(&q);\n    }\n    let resp = req.send().await?;\n    let status = resp.status();\n    let body: Value = resp\n        .json()\n        .await\n        .map_err(|e| anyhow!(\"FxTwitter: resposta invalida ({})\", e))?;\n    let code = body\n        .get(\"code\")\n        .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}","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/x/fx.rs#L34-L70","documentation":"FxTwitter returned code 404 (or the HTTP status defaulted to 404), so fx.rs maps it to this explicit not-found error. It distinguishes 'the tweet/user does not exist' from 'it exists but is private', though both are reported together.","triggerScenarios":"Calling status/thread/conversation/profile/profile_statuses/profile_media with a deleted or never-existing tweet ID, a mistyped handle, or an ID that FxTwitter cannot resolve.","commonSituations":"Typos or truncation in tweet IDs/URLs; deleted posts; suspended accounts; extracting the wrong path segment from a pasted X URL; regional/geo-blocked content returning 404.","solutions":["Validate the tweet ID / handle before calling (ID should be all digits; handle should match ^[A-Za-z0-9_]{1,15}$).","Confirm the post still exists by opening the x.com URL in a logged-out browser.","Check that the input was a full URL parsed to the correct status ID segment.","If the content should exist, retry later — suspension/geo states can change."],"exampleFix":"// before\nlet id = url.split('/').last().unwrap();\nstatus(id).await?;\n// after\nlet id = url.trim_end_matches('/').rsplit('/').next().unwrap();\nif !id.chars().all(|c| c.is_ascii_digit()) {\n    return Err(anyhow!(\"ID de post invalido: {}\", id));\n}\nstatus(id).await?;","handlingStrategy":"validation","validationCode":"fn validate_post_id(id: &str) -> Result<(), String> {\n    if id.is_empty() || !id.chars().all(|c| c.is_ascii_digit()) {\n        return Err(format!(\"ID de post deve ser numerico, recebi: {id}\"));\n    }\n    Ok(())\n}\nfn validate_handle(h: &str) -> Result<(), String> {\n    let h = h.trim_start_matches('@');\n    if h.len() <= 15 && h.chars().all(|c| c.is_ascii_alphanumeric() || c == '_') { Ok(()) } else { Err(format!(\"handle invalido: {h}\")) }\n}","typeGuard":null,"tryCatchPattern":"match fx::status(&id).await {\n    Ok(p) => p,\n    Err(e) if e.to_string().contains(\"nao encontrado no X\") => {\n        eprintln!(\"post {id} nao existe ou e privado — pulando\");\n        return Ok(None); // skip, don't retry\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Validate tweet IDs are numeric and handles match X rules before calling","Parse full x.com URLs by extracting the numeric status segment","Treat 404 as permanent — never retry these inputs","Check deleted/suspended targets when ingesting user-provided links"],"tags":["fxtwitter","not-found","x","input-validation"],"backgroundTag":"resource-not-found","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"}