Skip to content

Commit

Permalink
fix: show stdout/err on error
Browse files Browse the repository at this point in the history
  • Loading branch information
xtuc committed Apr 14, 2022
1 parent e87c098 commit 75bfb79
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compress/algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ func runAlgorithm(ctx context.Context, alg string, args ...string) []byte {

log.Printf("algorithm: run %s\n", cmd)
err := cmd.Run()
// log.Println(string(stdOut.Bytes()))
// log.Println(string(stdErr.Bytes()))
util.Check(err)
if err != nil {
log.Println(stdOut.String())
log.Println(stdErr.String())
util.Check(err)
}

if stdErr.Len() > 0 {
panic(fmt.Sprintf("%s failed: %s", alg, stdErr.String()))
Expand Down

0 comments on commit 75bfb79

Please sign in to comment.