Skip to content

Commit feb0e71

Browse files
[errors] Add verbose errors on execution failure.
1 parent 0dc7747 commit feb0e71

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

sources/lib/commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ func doHandleExecuteScriptletSsh (_library LibraryStore, _scriptlet *Scriptlet,
350350
}
351351

352352
if _error := _sshCommand.Run (); _error != nil {
353-
return false, errorw (0x881a60b5, _error)
353+
return false, errorf (0x881a60b5, "failed to spawn `%s` // %v", _sshCommand.Path, _error)
354354
}
355355

356356
return true, nil

sources/lib/execution.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ func executeScriptlet_0 (_scriptletLabel string, _command *exec.Cmd, _descriptor
702702

703703
if _error := syscall.Exec (_command.Path, _command.Args, _command.Env); _error != nil {
704704
_closeDescriptors ()
705-
return errorw (0x99b54af1, _error)
705+
return errorf (0x99b54af1, "failed to exec `%s` // %v", _command.Path, _error)
706706
} else {
707707
panic (0xb6dfe17e)
708708
}

sources/lib/premain.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func PreMain () () {
122122
_environment = append (_environment, "ZRUN_EXECUTABLE=" + _executable)
123123

124124
if _error := syscall.Exec (_bash, _arguments, _environment); _error != nil {
125-
panic (abortError (errorw (0x8598d4c0, _error)))
125+
panic (abortError (errorf (0x8598d4c0, "failed to exec `%s` // %v", _bash, _error)))
126126
}
127127
panic (0xf4813cc2)
128128

@@ -429,7 +429,7 @@ func PreMain () () {
429429
_delegateArguments := append ([]string {_delegateArgument0}, _delegateArguments ...)
430430

431431
if _error := syscall.Exec (_delegateExecutable, _delegateArguments, _delegateEnvironment); _error != nil {
432-
panic (abortError (errorw (0x05bd220d, _error)))
432+
panic (abortError (errorf (0x05bd220d, "failed to exec `%s` // %v", _delegateExecutable, _error)))
433433
} else {
434434
panic (0xe13aab5f)
435435
}
@@ -560,7 +560,7 @@ func PreMainReExecute (_executable string) (*Error) {
560560
_arguments,
561561
PreMainContextGlobal.Environment,
562562
)
563-
return errorw (0x3d993836, _error)
563+
return errorf (0x3d993836, "failed to exec `%s` // %v", _executable, _error)
564564
}
565565

566566

sources/lib/processes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func processExecuteAndPipe (_command *exec.Cmd, _inputsChannel <-chan string, _o
3838
}
3939

4040
if _error := _command.Start (); _error != nil {
41-
return -1, 0, 0, errorw (0x26e1988c, _error)
41+
return -1, 0, 0, errorf (0x26e1988c, "failed to spawn `%s` // %v", _command.Path, _error)
4242
}
4343

4444
_waiter := & sync.WaitGroup {}

0 commit comments

Comments
 (0)