From 4a3aa05c8f3efd0f00493d3b625e30965df1a006 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 3 Jan 2024 16:46:32 +0200 Subject: fix(ops/besadii): error formatting Errors can only be wrapped in fmt.Errorf, in these two cases, we want to print their string representation to stderr. Change-Id: I65d345daacdd3960428ce82b5fdafceae61c6cc7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10527 Autosubmit: flokli Reviewed-by: tazjin Tested-by: BuildkiteCI --- ops/besadii/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ops/besadii/main.go b/ops/besadii/main.go index e97ca1136cc5..809acc29e8b4 100644 --- a/ops/besadii/main.go +++ b/ops/besadii/main.go @@ -187,7 +187,7 @@ func updateGerrit(cfg *config, review reviewInput, changeId, patchset string) { url := fmt.Sprintf("%s/a/changes/%s/revisions/%s/review", cfg.GerritUrl, changeId, patchset) req, err := http.NewRequest("POST", url, reader) if err != nil { - fmt.Fprintf(os.Stderr, "failed to create an HTTP request: %w", err) + fmt.Fprintf(os.Stderr, "failed to create an HTTP request: %s", err) os.Exit(1) } @@ -196,7 +196,7 @@ func updateGerrit(cfg *config, review reviewInput, changeId, patchset string) { resp, err := http.DefaultClient.Do(req) if err != nil { - fmt.Errorf("failed to update %s on %s: %w", cfg.GerritChangeName, cfg.GerritUrl, err) + fmt.Fprintf(os.Stderr, "failed to update %s on %s: %s", cfg.GerritChangeName, cfg.GerritUrl, err) } defer resp.Body.Close() -- cgit 1.4.1