diff options
author | Wolfy-J <[email protected]> | 2018-06-03 21:49:57 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-03 21:49:57 +0300 |
commit | ed2719f7d4fc4ccde61e3a5c104a49b7e9e9ea5f (patch) | |
tree | a2a005a037cd1b1a959fc6a2323b4908d341a087 /socket_factory.go | |
parent | 7877e54547d1f8ca3b3431c6e9aa3cbd80af1403 (diff) |
error handling
Diffstat (limited to 'socket_factory.go')
-rw-r--r-- | socket_factory.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/socket_factory.go b/socket_factory.go index acdc91b1..c7fe639d 100644 --- a/socket_factory.go +++ b/socket_factory.go @@ -54,7 +54,11 @@ func (f *SocketFactory) SpawnWorker(cmd *exec.Cmd) (w *Worker, err error) { 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") |