From c8b2d8f8630713e377187b2d92710e793f5b7951 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Mon, 21 Oct 2024 16:34:39 -0700 Subject: [PATCH] bug: log http response bodies in failed daemon calls --- pkg/engine/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/engine/http.go b/pkg/engine/http.go index 304f89c4..0742b236 100644 --- a/pkg/engine/http.go +++ b/pkg/engine/http.go @@ -96,8 +96,8 @@ func (e *Engine) runHTTP(ctx context.Context, prg *types.Program, tool types.Too defer resp.Body.Close() if resp.StatusCode > 299 { - _, _ = io.ReadAll(resp.Body) - return nil, fmt.Errorf("error in request to [%s] [%d]: %s", toolURL, resp.StatusCode, resp.Status) + body, _ := io.ReadAll(resp.Body) + return nil, fmt.Errorf("error in request to [%s] [%d]: %s: %s", toolURL, resp.StatusCode, resp.Status, body) } content, err := io.ReadAll(resp.Body)