From 75bfb793bc3c0078d43f5b55c989fa48614e5106 Mon Sep 17 00:00:00 2001 From: Sven Sauleau Date: Thu, 14 Apr 2022 17:41:51 +0100 Subject: [PATCH] fix: show stdout/err on error --- compress/algorithm.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compress/algorithm.go b/compress/algorithm.go index 941605f..c387b80 100644 --- a/compress/algorithm.go +++ b/compress/algorithm.go @@ -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()))