From d1b7784357f758ca7ad4041f5fd056960f50252d Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Thu, 11 Mar 2021 14:29:30 +0000 Subject: [PATCH] Use `ErrUnexpectedStatus` more consistently Signed-off-by: Ilya Dmitrichenko --- remotes/docker/pusher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remotes/docker/pusher.go b/remotes/docker/pusher.go index 94a270cb7..0da62f4f7 100644 --- a/remotes/docker/pusher.go +++ b/remotes/docker/pusher.go @@ -354,7 +354,7 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di switch resp.StatusCode { case http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusAccepted: default: - return errors.Errorf("unexpected status: %s", resp.Status) + return remoteserrors.NewUnexpectedStatusErr(resp.Response) } status, err := pw.tracker.GetStatus(pw.ref)