Skip to content

Commit

Permalink
エラー時もstdout, stderrを返すように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
fmhr committed Apr 19, 2024
1 parent d14ba76 commit 6b46086
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion unix_specific.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ func runCommandWithTimeout(cmdStrings []string, cnf *Config) ([]byte, string, er
}
case err := <-errCh:
if err != nil {
rtn := make([]byte, 0, len(stdoutBuf.Bytes())+len(stderrBuf.Bytes()))
rtn = append(rtn, stdoutBuf.Bytes()...)
rtn = append(rtn, stderrBuf.Bytes()...)
log.Println("Error: ", err, "command:", cmd.String())
return nil, result, fmt.Errorf("cmd.Wait() failed with: %v", err)
return rtn, result, fmt.Errorf("cmd.Wait() failed with: %v", err)
}
}

Expand Down

0 comments on commit 6b46086

Please sign in to comment.