aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-11-04 10:27:59 +0100
committerTaras Madan <tarasmadan@google.com>2024-11-04 11:47:46 +0000
commit2c4d2e02c3ededab70593ceb9631a2b551823be1 (patch)
tree38faf478df5e97d9653c9527e0a47c0c542c793a /dashboard
parent0754ea125cefb032c96b3689ca56ad1cf29daaae (diff)
dashboard/api: better error description
"error: api request "https://syzkaller.appspot.com/text?json=1&tag=ReproC&x=11003952980000" failed: 500 (%!w(<nil>))" We have a 500 error w/o explanation. Let's dump some body here.
Diffstat (limited to 'dashboard')
-rw-r--r--dashboard/api/client.go3
1 files changed, 2 insertions, 1 deletions
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
}