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 <flokli@flokli.de>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-01-03 16:46:32 +02:00 committed by clbot
parent f17b780035
commit 4a3aa05c8f

View file

@ -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()