From 37531001bcf44495ffe0a74d2c49cd688c429355 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Wed, 7 May 2025 18:26:18 -0400 Subject: [PATCH] Improve formatting of an error message --- ctclient/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ctclient/client.go b/ctclient/client.go index 7a341da..69acec2 100644 --- a/ctclient/client.go +++ b/ctclient/client.go @@ -11,6 +11,7 @@ package ctclient import ( + "bytes" "context" "crypto/tls" "encoding/json" @@ -79,7 +80,7 @@ func get(ctx context.Context, httpClient *http.Client, fullURL string) ([]byte, } if response.StatusCode != 200 { - return nil, fmt.Errorf("Get %q: %s (%q)", fullURL, response.Status, string(responseBody)) + return nil, fmt.Errorf("Get %q: %s (%q)", fullURL, response.Status, bytes.TrimSpace(responseBody)) } return responseBody, nil