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(()) }