From fff52bfbba03991082931ebcecd183849d1acd55 Mon Sep 17 00:00:00 2001 From: Peter Waller Date: Mon, 2 Jun 2014 19:35:13 +0100 Subject: [PATCH] Check ps.Start() error This doesn't usually happen unless the shell is broken or unavailable. It's nice though to have a program which shows an error message rather than quitting silently. The test to see if this is working is to modify the shell in `unix.go` to something which doesn't exist. --- start.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/start.go b/start.go index 0a5a953..4fe38b1 100644 --- a/start.go +++ b/start.go @@ -126,7 +126,12 @@ func (f *Forego) startProcess(idx, procNum int, proc ProcfileEntry, env Env, of finished := make(chan struct{}) // closed on process exit - ps.Start() + err = ps.Start() + if err != nil { + f.teardown.Fall() + of.SystemOutput(fmt.Sprint("Failed to start ", procName, ": ", err)) + return + } f.wg.Add(1) go func() {