tonhowtf/omniget · error · anyhow::Error

No stderr from gallery-dl

Error message

No stderr from gallery-dl

What it means

A defensive guard in download(): child.stderr was None when taken, so the process has no piped stderr handle and error diagnostics from gallery-dl can never be captured. Like the stdout case, it indicates stdio was not set to piped before spawn — an internal setup error rather than a download failure.

Solutions

  1. Ensure stderr is piped when building the gallery-dl command
  2. Update the app so stdio configuration is applied before spawn
  3. Report the issue if it reproduces with a current version
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src-tauri/src/platforms/gallerydl/mod.rs:247 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/f38551693bc00369. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/src/platforms/gallerydl/mod.rs:247

                cmd.arg("--cookies").arg(&cookie_file);
            }
        }

        cmd.arg("--").arg(&url);

        cmd.kill_on_drop(true);
        let mut child = cmd
            .spawn()
            .map_err(|e| anyhow!("Failed to start gallery-dl: {}", e))?;

        let stdout = child
            .stdout
            .take()
            .ok_or_else(|| anyhow!("No stdout from gallery-dl"))?;
        let stderr_pipe = child
            .stderr
            .take()
            .ok_or_else(|| anyhow!("No stderr from gallery-dl"))?;

        let started_at = SystemTime::now();

        let progress_tx = progress.clone();
        let reader_task = tokio::spawn(async move {
            let mut lines = BufReader::new(stdout).lines();
            let mut count: u64 = 0;
            let mut last_emit = std::time::Instant::now();
            while let Ok(Some(line)) = lines.next_line().await {
                let trimmed = line.trim();
                if trimmed.is_empty() || trimmed.starts_with('#') || trimmed.starts_with('[') {
                    continue;
                }
                count += 1;
                if last_emit.elapsed() >= std::time::Duration::from_millis(250) {
                    let pct = ((count as f64 / (count as f64 + 4.0)) * 100.0).min(95.0);
                    let _ = progress_tx.send(ProgressUpdate::percent(pct)).await;
                    last_emit = std::time::Instant::now();

View on GitHub (pinned to 8600b91f42)