From 0ba44206b1cc6ed396d3074eea7a93f1320ec07c Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 1 Sep 2025 11:51:23 -0700 Subject: [PATCH] Print the body for debug --- websocket/client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/websocket/client.go b/websocket/client.go index 5020ec1..7ee0e88 100644 --- a/websocket/client.go +++ b/websocket/client.go @@ -6,6 +6,7 @@ import ( "crypto/x509" "encoding/json" "fmt" + "io" "net/http" "net/url" "os" @@ -281,8 +282,9 @@ func (c *Client) getToken() (string, error) { defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - logger.Error("Failed to get token with status code: %d", resp.StatusCode) - return "", fmt.Errorf("failed to get token with status code: %d", resp.StatusCode) + body, _ := io.ReadAll(resp.Body) + logger.Error("Failed to get token with status code: %d, body: %s", resp.StatusCode, string(body)) + return "", fmt.Errorf("failed to get token with status code: %d, body: %s", resp.StatusCode, string(body)) } var tokenResp TokenResponse