tonhowtf/omniget · error · IgError
e.to_string()
Error message
e.to_string()
What it means
publish_web defines a local mapper m = |e: IgError| anyhow!(e.to_string()) used to convert Instagram client errors into anyhow errors at each upload/configure step; the surfaced message is the Display of the underlying IgError.
Solutions
- Read the stringified IgError to identify auth vs upload vs HTTP failure
- Refresh Instagram login/session credentials if auth-related
- Retry transient failures with backoff; respect rate limits
- Validate media constraints (aspect ratio, duration, size) before upload
Defensive patterns
Strategy: try-catch
Validate before calling
// pre-validate session and media before publish assert_session_valid(client)?; validate_media_constraints(&req.files)?;
Try / catch
match publish_web(req, progress, job).await { Err(e) => { log::error!("publish failed: {e}"); if e.to_string().to_lowercase().contains("login") { reauth()?; } else { return Err(e); } }, ok => ok } Prevention
- Refresh Instagram session before long publish jobs
- Check rate limits between uploads
- Validate media dimensions/duration/size before upload
When it happens
Trigger: Any Instagram API call inside publish_web (photo upload, video upload, carousel items, configure) returning Err(IgError) other than the special transcode/202 cases.
Common situations: Instagram session expired, media upload rejected (bad dimensions/duration), rate limiting, or transient HTTP failures during rupload.
Related errors
- e.to_string()
- nao achei os arquivos JSON de seguidores no export. No…
- escolha pelo menos um arquivo
- tipo desconhecido
- Could not resolve share link
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/5ee2e2f6485a1660.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/instagram/publish.rs:308
("is_meta_only_post", "0".into()),
]
}
/// Publica pela sessão web.
pub async fn publish_web(
client: &IgClient,
req: &PublishRequest,
progress: &super::super::ProgressFn,
job: &str,
) -> anyhow::Result<PublishResult> {
let id = format!("ig:{}", job);
if req.files.is_empty() {
return Err(anyhow!("escolha pelo menos um arquivo"));
}
let report = |stage: &str, done: u64, total: u64| {
super::super::report(progress, &id, stage, done, Some(total), None)
};
let m = |e: IgError| anyhow!(e.to_string());
match req.kind.as_str() {
"photo" => {
report("upload", 0, 2);
let uid = upload_id();
let (bytes, w, h) = as_jpeg(Path::new(&req.files[0])).await?;
rupload_photo(client, bytes, w, h, &uid, &[])
.await
.map_err(m)?;
report("configure", 1, 2);
let json = client
.post_form("/api/v1/media/configure/", &common_form(req, &uid))
.await
.map_err(m)?;
report("done", 2, 2);
Ok(result_of(&json))
}
"story" => {
let path = Path::new(&req.files[0]);View on GitHub (pinned to 8600b91f42)