From d1f3731374313502b475dda4592eda7543470d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Fri, 5 Jun 2026 18:05:28 +0300 Subject: [PATCH] fix: handle missing system commands --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index d907619..ebd171f 100755 --- a/app.py +++ b/app.py @@ -84,6 +84,11 @@ def run_cmd(cmd, timeout=120): start = time.time() try: proc = subprocess.run(cmd, shell=False, capture_output=True, text=True, timeout=timeout) + except FileNotFoundError as e: + dur_ms = int((time.time() - start) * 1000) + msg = f"command not found: {e.filename or cmd[0]}" + log_event("error", "command_not_found", cmd=cmd, duration_ms=dur_ms, stderr=msg) + return 127, "", msg except subprocess.TimeoutExpired as e: dur_ms = int((time.time() - start) * 1000) log_event("error", "command_timeout", cmd=cmd, duration_ms=dur_ms)