Skip to content

Commit

Permalink
Merge pull request #251 from cdnjs/sven/debug
Browse files Browse the repository at this point in the history
fix: show stdout/err on error
  • Loading branch information
xtuc authored Apr 14, 2022
2 parents e87c098 + 75bfb79 commit 5a157cb
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 5a157cb

Please sign in to comment.