Skip to content

Commit

Permalink
Suppress error logs when killing process on Windows
Browse files Browse the repository at this point in the history
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").
  • Loading branch information
brandondong committed Feb 5, 2025
1 parent fd5c031 commit 7d50692
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,13 @@ func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), p
refreshViewIfStale()

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

Expand Down

0 comments on commit 7d50692

Please sign in to comment.