tonhowtf/omniget · error

FxTwitter: ( )

Error message

FxTwitter: {} ({})

What it means

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.

Solutions

  1. Read the embedded code and message: retry for 5xx with backoff, fix input for 4xx.
  2. Log the full body alongside the code for diagnosis of new/unmapped error codes.
  3. Check FxTwitter's status or repository for known incidents or API changes.
  4. Fall back to the native authenticated X client for persistent upstream failures.

Example fix

null
Defensive patterns

Strategy: retry

Try / catch

match fx::status(&id).await {
    Ok(p) => p,
    Err(e) if e.to_string().contains("FxTwitter: ") => {
        // embedded code decides: retry 5xx, fail fast 4xx
        if let Some(code) = extract_code(&e) {
            if code >= 500 { retry_with_backoff(|| fx::status(&id)).await }
            else { Err(e) }
        } else { Err(e) }
    }
    Err(e) => Err(e),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/c0f0dbdc1b7efb16. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/x/fx.rs:67

        .and_then(|c| c.as_u64())
        .unwrap_or(status.as_u16() as u64);
    if code == 404 {
        return Err(anyhow!("nao encontrado no X (ou o post e privado)"));
    }
    if code == 401 {
        return Err(anyhow!("post ou perfil privado"));
    }
    if code == 429 {
        return Err(anyhow!(
            "FxTwitter: limite de requisicoes atingido, tente de novo em instantes"
        ));
    }
    if code >= 400 {
        let msg = body
            .get("message")
            .and_then(|m| m.as_str())
            .unwrap_or("erro");
        return Err(anyhow!("FxTwitter: {} ({})", msg, code));
    }
    Ok(body)
}

fn s(v: &Value, k: &str) -> String {
    v.get(k).and_then(|x| x.as_str()).unwrap_or("").to_string()
}

fn n(v: &Value, k: &str) -> u64 {
    v.get(k)
        .and_then(|x| x.as_u64().or_else(|| x.as_f64().map(|f| f.max(0.0) as u64)))
        .unwrap_or(0)
}

pub fn user_from(v: &Value) -> XUser {
    XUser {
        id: s(v, "id"),
        handle: s(v, "screen_name"),

View on GitHub (pinned to 8600b91f42)