tonhowtf/omniget · error

não consegui gravar

Error message

não consegui gravar {}: {}

What it means

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.

Solutions

  1. Check write permissions on the output directory and pick a writable location
  2. Free disk space if the volume is full
  3. Ensure the file is not locked by another program or the same export running twice
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src-tauri/src/platforms/bilibili/danmaku/export.rs:176 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src-tauri/src/platforms/bilibili/danmaku/export.rs:176

    if kept_elems.is_empty() {
        return Err(anyhow!(
            "os filtros não deixaram nenhum comentário de pé ({} vieram do Bilibili)",
            fetched
        ));
    }

    let dir = output_dir(&opts.output_dir)?;
    std::fs::create_dir_all(&dir)?;
    let stem = file_stem(&parsed.title, part, parts.len());
    let mut files = Vec::new();
    for format in wanted_formats(&opts.formats) {
        let body = match format {
            DanmakuFormat::Ass => super::ass::render(&kept_elems, &opts.style),
            other => super::render(&kept_elems, other),
        };
        let path = dir.join(format!("{}.danmaku.{}", stem, format.extension()));
        std::fs::write(&path, &body)
            .map_err(|e| anyhow!("não consegui gravar {}: {}", path.display(), e))?;
        files.push(ExportFile {
            format: format.extension().to_string(),
            path: path.to_string_lossy().to_string(),
            bytes: body.len() as u64,
        });
    }

    report(progress, ID, "done", 4, Some(4), None);
    Ok(ExportResult {
        title: parsed.title.clone(),
        part: part.clone(),
        parts,
        fetched,
        kept: kept_elems.len(),
        files,
        with_account,
    })
}

View on GitHub (pinned to 8600b91f42)