Skip to content

Commit e577442

Browse files
committed
have stream_command raise exception
1 parent 52cdb28 commit e577442

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/warnet/process.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def run_command(command: str) -> str:
1010
return result.stdout
1111

1212

13-
def stream_command(command: str, env=None) -> bool:
13+
def stream_command(command: str) -> bool:
1414
process = subprocess.Popen(
1515
["/bin/bash", "-c", command],
1616
stdout=subprocess.PIPE,
@@ -27,6 +27,5 @@ def stream_command(command: str, env=None) -> bool:
2727
return_code = process.wait()
2828

2929
if return_code != 0:
30-
print(f"Command failed with return code {return_code}")
31-
return False
30+
raise Exception(process.stderr)
3231
return True

0 commit comments

Comments
 (0)