tonhowtf/omniget · error · anyhow
other.message()
Error message
other.message()
What it means
Generic catch-all in wait_for_token's polling loop: any Poll outcome other than Success/SlowDown/Pending/Expired (e.g. Poll::Denied) is converted to an anyhow error via its message(). Most commonly this is the user explicitly denying the authorization request on trakt.tv/activate.
Solutions
- Read the error message from Poll::other.message() to identify the exact outcome
- If denied, restart the flow with device_code() and have the user approve this time
- Ensure the user enters the code under the correct Trakt account
- Update match arms if Trakt introduced new poll statuses
Defensive patterns
Strategy: try-catch
Try / catch
match wait_for_token(&dc, progress).await {
Err(e) => {
let msg = e.to_string();
if msg.contains("negad") || msg.contains("denied") {
// explain denial and offer to restart device_code()
} else {
return Err(e);
}
}
Ok(res) => { /* connected */ }
} Prevention
- Instruct users to click 'allow' (not 'deny') at trakt.tv/activate
- Handle each Poll variant explicitly instead of relying on the catch-all
- Log the unrecognized variant to catch new Trakt poll statuses
When it happens
Trigger: The device-token poll endpoint returns a terminal status that maps to an unhandled Poll variant — typically Deny when the user clicks 'deny' during activation.
Common situations: User denied the request at trakt.tv/activate; an unrecognized poll response maps to a new Poll variant the caller did not anticipate.
Related errors
- informe primeiro o client_id da sua app do Trakt
- o device flow precisa do client_secret da sua app do Trakt
- o Trakt não devolveu o código do dispositivo
- o Trakt recusou o pedido de código
- Poll::Expired.message()
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/1113d5da9db7708c.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/lists/trakt.rs:342
"client_secret": c.client_secret,
}))
.send()
.await?;
let status = r.status().as_u16();
match poll_state(status) {
Poll::Done => {
let v: Value = r.json().await?;
let username = save_token(&v)?;
report(&p, TOOL_ID, "done", 1, Some(1), None);
return Ok(ConnectResult {
connected: true,
username: username.clone(),
message: format!("conectado como {}", username),
});
}
Poll::SlowDown => interval += Duration::from_secs(dc.interval.max(1)),
Poll::Pending => {}
other => return Err(anyhow!("{}", other.message())),
}
}
}
fn save_token(v: &Value) -> Result<String> {
let access = v
.get("access_token")
.and_then(|x| x.as_str())
.unwrap_or_default()
.to_string();
if access.is_empty() {
return Err(anyhow!("o Trakt não devolveu o token"));
}
let refresh = v
.get("refresh_token")
.and_then(|x| x.as_str())
.unwrap_or_default()
.to_string();View on GitHub (pinned to 8600b91f42)