{"record":{"id":"dda5455fbb9b3177","repo":"tonhowtf/omniget","slug":"formato-desconhecido","errorCode":null,"errorMessage":"formato desconhecido: {}","messagePattern":"formato desconhecido: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/twitch/chat.rs","lineNumber":551,"sourceCode":"                serde_json::to_string_pretty(&json!({\n                    \"video\": {\n                        \"id\": info.id,\n                        \"title\": info.title,\n                        \"channel\": info.channel,\n                        \"channel_display\": info.channel_display,\n                        \"created_at\": info.created_at,\n                        \"duration_seconds\": info.duration_seconds,\n                    },\n                    \"messages\": messages,\n                    \"peaks_per_minute\": series,\n                }))?,\n            ),\n            \"csv\" => (\"csv\", to_csv(&messages)),\n            \"srt\" | \"ass\" | \"vtt\" => {\n                let cues = to_cues(&messages, opts.window_seconds, opts.max_lines);\n                (format.as_str(), subtitle::render(&cues, format))\n            }\n            other => bail!(\"formato desconhecido: {}\", other),\n        };\n        let path = dir.join(format!(\"{}.{}\", stem, ext));\n        std::fs::write(&path, body)?;\n        files.push(path.to_string_lossy().to_string());\n    }\n\n    let sample = messages.iter().take(30).cloned().collect();\n    Ok(Result {\n        video_id: info.id,\n        title: info.title,\n        channel: if info.channel_display.is_empty() {\n            info.channel\n        } else {\n            info.channel_display\n        },\n        duration_seconds: info.duration_seconds,\n        messages: messages.len(),\n        pages,","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/twitch/chat.rs#L533-L569","documentation":"export() validates each requested output format against a fixed set (json, csv, srt, ass, vtt). Any format string outside that set reaches the catch-all `other =>` arm and bails with \"formato desconhecido: {}\". The library does not pre-validate formats, so the error surfaces only when rendering files.","triggerScenarios":"Calling export() with opts.formats containing anything other than \"json\", \"csv\", \"srt\", \"ass\", or \"vtt\" (case-insensitive) — e.g. \"txt\", \"xml\", \"JSONL\", or a locale-mangled value.","commonSituations":"Users typing an intuitive but unsupported extension like \"text\" or \"ssa\" in a config file; copying format names from another tool; passing a comma-separated string instead of individual format entries.","solutions":["Use only the supported formats: json, csv, srt, ass, vtt (case-insensitive).","Fix the formats value in your config/CLI invocation — check for typos and stray whitespace.","Validate format strings against the allowed list before calling export()."],"exampleFix":"// before\nlet opts = ChatOpts { formats: vec![\"txt\".into()], ..Default::default() }; // bail: formato desconhecido: txt\n\n// after\nlet allowed = [\"json\", \"csv\", \"srt\", \"ass\", \"vtt\"];\nlet formats: Vec<String> = vec![\"txt\".into()]\n    .into_iter()\n    .filter(|f| allowed.contains(&f.to_lowercase().as_str()))\n    .collect();\nlet opts = ChatOpts { formats, ..Default::default() };","handlingStrategy":"validation","validationCode":"const SUPPORTED: [&str; 5] = [\"json\", \"csv\", \"srt\", \"ass\", \"vtt\"];\nfn validate_formats(formats: &[String]) -> Result<(), String> {\n    formats.iter()\n        .find(|f| !SUPPORTED.contains(&f.to_lowercase().as_str()))\n        .map(|f| Err(format!(\"formato desconhecido: {}\", f)))\n        .unwrap_or(Ok(()))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whitelist formats at config-parse time (json, csv, srt, ass, vtt).","Normalize case and trim whitespace when accepting format strings from users.","Avoid hardcoding format lists copied from other tools.","Add an integration test asserting every configured format is accepted."],"tags":["twitch","chat","format","invalid-argument"],"backgroundTag":"invalid-enum-value","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"}