Skip to content

Commit 00a3e42

Browse files
Fix silent 127/126 on unstartable commands
1 parent 876ffd3 commit 00a3e42

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/serialq/__init__.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,20 @@ def run_child(cmd, log_path=None, kill_after=None, forward_signals=False):
213213
start_new_session=True,
214214
)
215215
except FileNotFoundError:
216+
msg = f"failed to start: {cmd[0]}: command not found"
216217
if log:
217-
log.write(f"# failed to start: {cmd[0]}: command not found\n")
218+
log.write(f"# {msg}\n")
218219
log.close()
220+
else:
221+
print(f"serialq: error: {msg}", file=sys.stderr)
219222
return 127, False
220223
except OSError as e:
224+
msg = f"failed to start: {e}"
221225
if log:
222-
log.write(f"# failed to start: {e}\n")
226+
log.write(f"# {msg}\n")
223227
log.close()
228+
else:
229+
print(f"serialq: error: {msg}", file=sys.stderr)
224230
return 126, False
225231

226232
relay = {}

0 commit comments

Comments
 (0)