Skip to content

Commit 7d50692

Browse files
committed
Suppress error logs when killing process on Windows
There is a string check here to suppress the failure logs due to this reason but on Windows, the string is different ("exit status 1").
1 parent fd5c031 commit 7d50692

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/tasks/tasks.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,13 @@ func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), p
277277
refreshViewIfStale()
278278

279279
if err := cmd.Wait(); err != nil {
280-
// it's fine if we've killed this program ourselves
281-
if !strings.Contains(err.Error(), "signal: killed") {
282-
self.Log.Errorf("Unexpected error when running cmd task: %v; Failed command: %v %v", err, cmd.Path, cmd.Args)
280+
select {
281+
case <-opts.Stop:
282+
// it's fine if we've killed this program ourselves
283+
default:
284+
if !strings.Contains(err.Error(), "signal: killed") {
285+
self.Log.Errorf("Unexpected error when running cmd task: %v; Failed command: %v %v", err, cmd.Path, cmd.Args)
286+
}
283287
}
284288
}
285289

0 commit comments

Comments
 (0)