From 65f34103a75892e35755f33e2863fbbd7653c8d0 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:56:57 +0200 Subject: [PATCH] Update internal/maa/patch.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com> --- internal/maa/patch.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/maa/patch.go b/internal/maa/patch.go index d6dc2fd1d..d9ac35b4c 100644 --- a/internal/maa/patch.go +++ b/internal/maa/patch.go @@ -59,11 +59,8 @@ func (p AzurePolicyPatcher) Patch(ctx context.Context, attestationURL string) er defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - body, err := io.ReadAll(resp.Body) - if err != nil { - return fmt.Errorf("updating attestation policy: unexpected status code: %s\nread response body: %w", resp.Status, err) - } - return fmt.Errorf("updating attestation policy: unexpected status code: %s\nresponse body: %s", resp.Status, string(body)) + body, _ := io.ReadAll(resp.Body) + return fmt.Errorf("updating attestation policy: unexpected status code: %s: %s", resp.Status, string(body)) } return nil