Skip to content

Commit

Permalink
Improve error reporting when running $(${ProgramObject} ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyash-b committed Jun 22, 2024
1 parent d5b6114 commit 3e6e559
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/stdlib.ngs
Original file line number Diff line number Diff line change
Expand Up @@ -5798,6 +5798,8 @@ TEST assert(Program('ls')) == Program('ls')
doc EXPERIMENTAL!
F Arg(p:Program) p.name

F Str(p:Program) p.name

F init(pp:ProcessesPipeline, cp:CommandsPipeline) pp.set(
cp = cp
processes = []
Expand Down Expand Up @@ -6339,10 +6341,10 @@ F wait(p:Process) {
p.exit_signal = C_WTERMSIG(w[1])
finished_ok(p) returns p
message = collector/Lines() {
argv0 = ("'" + try p.command.argv[0] + "'") tor '(with unknown name)'
argv0 = ("'" + (try p.command.argv[0].Str()) + "'")
collect("Executing external process ${argv0} failed")
collect("Executable was found at ${p.executable}")
collect("Command: ${p.command.argv.map(escape_bash).join(' ') tor '(unavailable)'}")
collect("Command: ${p.command.argv.map(Str).map(escape_bash).join(' ') tor '(unavailable)'}")
if p.exit_code is not Null {
collect("Command exited with code: ${p.exit_code}")
}
Expand Down

0 comments on commit 3e6e559

Please sign in to comment.