Use `ErrUnexpectedStatus` more consistently
@@ -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)
