{"record":{"id":"48a67f7e2b70dd0c","repo":"tonhowtf/omniget","slug":"n-o-consegui-gravar","errorCode":null,"errorMessage":"não consegui gravar {}: {}","messagePattern":"não consegui gravar (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/bilibili/danmaku/export.rs","lineNumber":176,"sourceCode":"    if kept_elems.is_empty() {\n        return Err(anyhow!(\n            \"os filtros não deixaram nenhum comentário de pé ({} vieram do Bilibili)\",\n            fetched\n        ));\n    }\n\n    let dir = output_dir(&opts.output_dir)?;\n    std::fs::create_dir_all(&dir)?;\n    let stem = file_stem(&parsed.title, part, parts.len());\n    let mut files = Vec::new();\n    for format in wanted_formats(&opts.formats) {\n        let body = match format {\n            DanmakuFormat::Ass => super::ass::render(&kept_elems, &opts.style),\n            other => super::render(&kept_elems, other),\n        };\n        let path = dir.join(format!(\"{}.danmaku.{}\", stem, format.extension()));\n        std::fs::write(&path, &body)\n            .map_err(|e| anyhow!(\"não consegui gravar {}: {}\", path.display(), e))?;\n        files.push(ExportFile {\n            format: format.extension().to_string(),\n            path: path.to_string_lossy().to_string(),\n            bytes: body.len() as u64,\n        });\n    }\n\n    report(progress, ID, \"done\", 4, Some(4), None);\n    Ok(ExportResult {\n        title: parsed.title.clone(),\n        part: part.clone(),\n        parts,\n        fetched,\n        kept: kept_elems.len(),\n        files,\n        with_account,\n    })\n}","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/bilibili/danmaku/export.rs#L158-L194","documentation":"Writing one of the export files (ASS/SRT/XML etc.) to the output directory failed at the std::fs level; the {} placeholders are the target file path and the io error. Fires after filtering succeeded, when the directory was created but the file itself could not be written — permissions, read-only location, or disk full.","triggerScenarios":"Thrown at src-tauri/src/platforms/bilibili/danmaku/export.rs:176 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check write permissions on the output directory and pick a writable location","Free disk space if the volume is full","Ensure the file is not locked by another program or the same export running twice"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}