From 2ca41514440afd587d0510997b5fdf5755ba9608 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Mon, 6 Jul 2026 13:56:44 -0500 Subject: [PATCH] fix(calendar): fall back to stdout when readpst's stderr is empty readpst writes some failure messages to stdout rather than stderr, so a failing run with empty stderr surfaced as a blank "parse failed: " error with no diagnostic content. --- src-tauri/src/calendar/mod.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/calendar/mod.rs b/src-tauri/src/calendar/mod.rs index e99450f..d6711e2 100644 --- a/src-tauri/src/calendar/mod.rs +++ b/src-tauri/src/calendar/mod.rs @@ -79,9 +79,15 @@ fn run_readpst(pst_path: &str, out_dir: &Path) -> Result<(), CalError> { _ => CalError::Open(e.to_string()), })?; if !output.status.success() { - return Err(CalError::Parse( - String::from_utf8_lossy(&output.stderr).trim().to_string(), - )); + // readpst writes some errors to stdout rather than stderr; show + // whichever stream actually has text, stderr first. + let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string(); + let message = if stderr.is_empty() { + String::from_utf8_lossy(&output.stdout).trim().to_string() + } else { + stderr + }; + return Err(CalError::Parse(message)); } Ok(()) }