From 2c4d2e02c3ededab70593ceb9631a2b551823be1 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Mon, 4 Nov 2024 10:27:59 +0100 Subject: dashboard/api: better error description "error: api request "https://syzkaller.appspot.com/text?json=1&tag=ReproC&x=11003952980000" failed: 500 (%!w())" We have a 500 error w/o explanation. Let's dump some body here. --- dashboard/api/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dashboard') diff --git a/dashboard/api/client.go b/dashboard/api/client.go index b2ad3a3d4..8bf204e72 100644 --- a/dashboard/api/client.go +++ b/dashboard/api/client.go @@ -106,7 +106,8 @@ func (c *Client) Text(query string) ([]byte, error) { defer res.Body.Close() body, err := io.ReadAll(res.Body) if res.StatusCode < 200 || res.StatusCode >= 300 || err != nil { - return nil, fmt.Errorf("api request %q failed: %v (%w)", queryURL, res.StatusCode, err) + return nil, fmt.Errorf("api request %q failed: status(%v) err(%w) body(%.1024s)", + queryURL, res.StatusCode, err, string(body)) } return body, nil } -- cgit mrf-deployment