{"record":{"id":"55f379d1fe7a76f4","repo":"tonhowtf/omniget","slug":"informe-o-seu-usu-rio-do-medium-ou-capture-os-cookies-de","errorCode":null,"errorMessage":"informe o seu usuário do Medium (ou capture os cookies de medium.com no gerenciador para incluir os rascunhos)","messagePattern":"informe o seu usuário do Medium \\(ou capture os cookies de medium\\.com no gerenciador para incluir os rascunhos\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/blogs/medium.rs","lineNumber":664,"sourceCode":"            Ok(d) => {\n                source = \"session\";\n                docs = d;\n            }\n            Err(e) => {\n                if user.is_empty() {\n                    return Err(e);\n                }\n                note = Some(format!(\n                    \"a sessão do Medium não respondeu ({}); saiu o que o feed público entrega\",\n                    e\n                ));\n            }\n        }\n    }\n\n    if docs.is_empty() {\n        if user.is_empty() {\n            return Err(anyhow!(\n                \"informe o seu usuário do Medium (ou capture os cookies de medium.com no gerenciador para incluir os rascunhos)\"\n            ));\n        }\n        crate::core::tools::report(&progress, ID, \"feed\", 0, None, Some(user.clone()));\n        let xml = fetcher.get_text(&feed_url(&user)).await?;\n        let items = parse_feed(&xml);\n        if items.is_empty() {\n            return Err(anyhow!(\n                \"o feed de @{} não trouxe nenhuma história publicada\",\n                user\n            ));\n        }\n        for it in items {\n            docs.push(doc_from_feed(&it, \"Medium\"));\n        }\n    }\n\n    if opts.limit > 0 && docs.len() > opts.limit {","sourceCodeStart":646,"sourceCodeEnd":682,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/blogs/medium.rs#L646-L682","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set opts.user to your Medium username before calling run()","Capture valid medium.com cookies in the session manager so from_session can list stories and the fallback is not needed","Verify the username field is populated in the UI/config that builds Options"],"exampleFix":"// before\nlet opts = Options { user: \"\".into(), ..Default::default() };\n// after\nlet opts = Options { user: \"someuser\".into(), ..Default::default() };","handlingStrategy":"validation","validationCode":"if opts.user.trim().is_empty() {\n    return Err(anyhow!(\"informe o usuário do Medium antes de exportar\"));\n}","typeGuard":null,"tryCatchPattern":"match run(&opts, progress).await {\n    Err(e) if e.to_string().contains(\"usuário do Medium\") => prompt_user_for_username(),\n    other => other?,\n}","preventionTips":["Make the username field required in the UI when no session cookies are present","Trim and validate opts.user when constructing Options","Persist the last used username in config"],"tags":["validation","medium","rust"],"backgroundTag":"missing-required-argument","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"}