diff --git a/apps/monitor/src/runner.rs b/apps/monitor/src/runner.rs index 9a1d051..3c58d67 100644 --- a/apps/monitor/src/runner.rs +++ b/apps/monitor/src/runner.rs @@ -194,13 +194,13 @@ async fn run_curl( let output = cmd.output().await.map_err(|e| format!("curl exec error: {e}"))?; - if !output.status.success() && output.stdout.is_empty() { + if !output.status.success() { let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - // curl exit 28 = timeout - let msg = if output.status.code() == Some(28) { - format!("timed out after {:.0}s", timeout_secs) - } else { - stderr.trim().to_string() + let msg = match output.status.code() { + Some(28) => format!("timed out after {:.0}s", timeout_secs), + Some(6) => "DNS lookup failed".to_string(), + Some(7) => "connection refused".to_string(), + _ => stderr.trim().to_string(), }; return Err(msg); }