summaryrefslogtreecommitdiff
path: root/pipe_factory.go
diff options
context:
space:
mode:
Diffstat (limited to 'pipe_factory.go')
-rw-r--r--pipe_factory.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pipe_factory.go b/pipe_factory.go
index 3b2f2f88..1ebcc69d 100644
--- a/pipe_factory.go
+++ b/pipe_factory.go
@@ -46,8 +46,13 @@ func (f *PipeFactory) SpawnWorker(cmd *exec.Cmd) (w *Worker, err error) {
if pid, err := fetchPID(w.rl); pid != *w.Pid {
go func(w *Worker) { w.Kill() }(w)
+
if wErr := w.Wait(); wErr != nil {
- err = errors.Wrap(wErr, err.Error())
+ if _, ok := wErr.(*exec.ExitError); ok {
+ err = errors.Wrap(wErr, err.Error())
+ } else {
+ err = wErr
+ }
}
return nil, errors.Wrap(err, "unable to connect to worker")