{"record":{"id":"c088e112c9306f34","repo":"tonhowtf/omniget","slug":"informe-o-blog","errorCode":null,"errorMessage":"informe o blog","messagePattern":"informe o blog","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/tumblr/backup.rs","lineNumber":515,"sourceCode":"fn media_map(posts: &[Post], index: &LocalIndex, root: &Path) -> HashMap<String, String> {\n    let mut map = HashMap::new();\n    if index.is_empty() {\n        return map;\n    }\n    for post in posts {\n        for url in &post.media {\n            if let Some(local) = index.file_for_url(url) {\n                map.insert(url.clone(), rel_to_root(root, &local));\n            }\n        }\n    }\n    map\n}\n\npub async fn run(opts: &Options, progress: &super::super::ProgressFn) -> Result<BackupResult> {\n    let url = blog_url(&opts.blog);\n    if url.is_empty() {\n        anyhow::bail!(\"informe o blog\");\n    }\n    let cookies = match opts.session_netscape.as_deref() {\n        Some(s) => gdl::write_cookies(s, &[\"tumblr.com\"])?,\n        None => None,\n    };\n    let used_session = cookies.is_some();\n    let cookie_path = cookies.as_ref().map(|c| c.path.clone());\n\n    let extra = vec![\n        \"-o\".to_string(),\n        \"extractor.tumblr.posts=all\".to_string(),\n        \"-o\".to_string(),\n        \"extractor.tumblr.reblogs=true\".to_string(),\n        \"-o\".to_string(),\n        \"extractor.tumblr.original=true\".to_string(),\n    ];\n\n    super::super::report(progress, TOOL_ID, \"started\", 0, None, Some(url.clone()));","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/tumblr/backup.rs#L497-L533","documentation":"The Tumblr backup tool derives the blog URL from the options before starting. If the blog field is empty the URL is empty and there is nothing to back up, so it bails with this short validation message.","triggerScenarios":"Calling backup `run` with Options whose `blog` field is empty or whitespace, causing blog_url() to return an empty string.","commonSituations":"Forgot to set the blog name in config or CLI; env var/flag not wired into Options; default-constructed Options passed directly to run.","solutions":["Set the `blog` field in Options to the target Tumblr blog name or URL","Validate the blog value before calling run (trim and check non-empty)","Check the CLI/config binding so the blog name actually reaches Options"],"exampleFix":"// before\nlet opts = Options { blog: String::new(), .. }; // empty\n// after\nlet opts = Options { blog: \"myblog\".into(), .. };","handlingStrategy":"validation","validationCode":"if opts.blog.trim().is_empty() {\n    return Err(anyhow!(\"blog é obrigatório\"));\n}","typeGuard":"fn blog_is_set(opts: &backup::Options) -> bool {\n    !opts.blog.trim().is_empty()\n}","tryCatchPattern":"match backup::run(&opts, progress).await {\n    Err(e) if e.to_string() == \"informe o blog\" => eprintln!(\"configure o campo blog\"),\n    Err(e) => return Err(e),\n    Ok(r) => use(r),\n}","preventionTips":["Treat blog as a required field in config and CLI validation","Fail fast in your own code before calling run","Wire the blog flag through to Options explicitly"],"tags":["tumblr","backup","validation","missing-argument"],"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-15T23:17:13.987Z"}