From 7549a7e1b57831cf6b08ce4700fc6e53417919f9 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Fri, 21 Jul 2023 11:54:11 +0200 Subject: all: use special placeholder for errors --- dashboard/dashapi/dashapi.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dashboard/dashapi/dashapi.go') 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 -- cgit mrf-deployment