aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/dashapi/dashapi.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2023-07-21 11:54:11 +0200
committerTaras Madan <tarasmadan@google.com>2023-07-24 09:12:13 +0000
commit7549a7e1b57831cf6b08ce4700fc6e53417919f9 (patch)
tree8e027cdaf7abbc52a5fb29c37c7137dfd2122e7a /dashboard/dashapi/dashapi.go
parentf7eecac8b446ef11cff4122de6f496ad5eaba3a9 (diff)
all: use special placeholder for errors
Diffstat (limited to 'dashboard/dashapi/dashapi.go')
-rw-r--r--dashboard/dashapi/dashapi.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go
index a64ee2ad5..21ba8df1a 100644
--- a/dashboard/dashapi/dashapi.go
+++ b/dashboard/dashapi/dashapi.go
@@ -945,7 +945,7 @@ func (dash *Dashboard) queryImpl(method string, req, reply interface{}) error {
if req != nil {
data, err := json.Marshal(req)
if err != nil {
- return fmt.Errorf("failed to marshal request: %v", err)
+ return fmt.Errorf("failed to marshal request: %w", err)
}
buf := new(bytes.Buffer)
gz := gzip.NewWriter(buf)
@@ -964,7 +964,7 @@ func (dash *Dashboard) queryImpl(method string, req, reply interface{}) error {
r.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := dash.doer(r)
if err != nil {
- return fmt.Errorf("http request failed: %v", err)
+ return fmt.Errorf("http request failed: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
@@ -973,7 +973,7 @@ func (dash *Dashboard) queryImpl(method string, req, reply interface{}) error {
}
if reply != nil {
if err := json.NewDecoder(resp.Body).Decode(reply); err != nil {
- return fmt.Errorf("failed to unmarshal response: %v", err)
+ return fmt.Errorf("failed to unmarshal response: %w", err)
}
}
return nil