neuralworm commited on
Commit
1ae567a
·
verified ·
1 Parent(s): 3d8f0a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -37,13 +37,14 @@ except Exception:
37
  # ---------------------------------------------------------------------------
38
 
39
  def run_capture(cmd):
40
- """Run a command and return stdout, raise RuntimeError with stderr on failure."""
41
  result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
42
  if result.returncode != 0:
43
- err_tail = result.stderr[-1000:] if result.stderr else ""
 
 
44
  raise RuntimeError("Command failed: " + " ".join(cmd) + "
45
- " + err_tail)
46
- {err_tail}")
47
  return result.stdout
48
 
49
 
 
37
  # ---------------------------------------------------------------------------
38
 
39
  def run_capture(cmd):
40
+ """Run a command and return stdout; raise RuntimeError with readable stderr on failure."""
41
  result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
42
  if result.returncode != 0:
43
+ stderr_text = result.stderr or ""
44
+ # Keep only tail to avoid massive logs
45
+ tail = stderr_text[-2000:]
46
  raise RuntimeError("Command failed: " + " ".join(cmd) + "
47
+ " + tail)
 
48
  return result.stdout
49
 
50