tonhowtf/omniget · error · anyhow::Error

informe o seu usuário do Medium (ou capture os cookies de…

Error message

informe o seu usuário do Medium (ou capture os cookies de medium.com no gerenciador para incluir os rascunhos)

What it means

After collecting documents, if none were found (e.g. the authenticated session listing yielded nothing), run() falls back to fetching the public RSS feed, which requires a Medium username. When opts.user is empty at that point, it cannot build the feed URL and throws this error.

Solutions

  1. Set opts.user to your Medium username before calling run()
  2. Capture valid medium.com cookies in the session manager so from_session can list stories and the fallback is not needed
  3. Verify the username field is populated in the UI/config that builds Options

Example fix

// before
let opts = Options { user: "".into(), ..Default::default() };
// after
let opts = Options { user: "someuser".into(), ..Default::default() };
Defensive patterns

Strategy: validation

Validate before calling

if opts.user.trim().is_empty() {
    return Err(anyhow!("informe o usuário do Medium antes de exportar"));
}

Try / catch

match run(&opts, progress).await {
    Err(e) if e.to_string().contains("usuário do Medium") => prompt_user_for_username(),
    other => other?,
}

Prevention

When it happens

Trigger: Calling run() with an empty opts.user AND the Medium session (cookies) returned no documents (docs.is_empty()), so the RSS-feed fallback path needs a username that is missing.

Common situations: User expected cookies alone to be enough but session listing failed silently (e.g. expired session, drafts-only scope); Options built from an empty settings form; typo causing user to be trimmed to empty.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/blogs/medium.rs:664

            Ok(d) => {
                source = "session";
                docs = d;
            }
            Err(e) => {
                if user.is_empty() {
                    return Err(e);
                }
                note = Some(format!(
                    "a sessão do Medium não respondeu ({}); saiu o que o feed público entrega",
                    e
                ));
            }
        }
    }

    if docs.is_empty() {
        if user.is_empty() {
            return Err(anyhow!(
                "informe o seu usuário do Medium (ou capture os cookies de medium.com no gerenciador para incluir os rascunhos)"
            ));
        }
        crate::core::tools::report(&progress, ID, "feed", 0, None, Some(user.clone()));
        let xml = fetcher.get_text(&feed_url(&user)).await?;
        let items = parse_feed(&xml);
        if items.is_empty() {
            return Err(anyhow!(
                "o feed de @{} não trouxe nenhuma história publicada",
                user
            ));
        }
        for it in items {
            docs.push(doc_from_feed(&it, "Medium"));
        }
    }

    if opts.limit > 0 && docs.len() > opts.limit {

View on GitHub (pinned to 8600b91f42)