From 293dda71698164e615b3790c23ba553b84aebcda Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 28 Dec 2022 11:41:27 -0800 Subject: [PATCH] lib/snapshot: improve log message on unexpected status code during attempts to create or delete snapshots Use "unexpected status code returned from %q: %d; expecting %d" log message format instead of less clear format "unexpected status code returned from %q; expecting %d; got %d" This is a follow-up for c612bb165e5620e6090b3ed1a0b50b2cf59ea3a3 --- lib/snapshot/snapshot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/snapshot/snapshot.go b/lib/snapshot/snapshot.go index f02f008ba..c356d3127 100644 --- a/lib/snapshot/snapshot.go +++ b/lib/snapshot/snapshot.go @@ -39,7 +39,7 @@ func Create(createSnapshotURL string) (string, error) { return "", err } if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("unexpected status code returned from %q; expecting %d; got %d; response body: %q", createSnapshotURL, http.StatusOK, resp.StatusCode, body) + return "", fmt.Errorf("unexpected status code returned from %q: %d; expecting %d; response body: %q", createSnapshotURL, resp.StatusCode, http.StatusOK, body) } snap := snapshot{} @@ -77,7 +77,7 @@ func Delete(deleteSnapshotURL string, snapshotName string) error { return err } if resp.StatusCode != http.StatusOK { - return fmt.Errorf("unexpected status code returned from %q; expecting %d; got %d; response body: %q", deleteSnapshotURL, resp.StatusCode, http.StatusOK, body) + return fmt.Errorf("unexpected status code returned from %q: %d; expecting %d; response body: %q", deleteSnapshotURL, resp.StatusCode, http.StatusOK, body) } snap := snapshot{}