From b0714e3765d142fe4804381880268a54cb4b984c Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 2 May 2025 17:16:36 +0200 Subject: pkg/gcs: check errors with errors.Is After https://github.com/googleapis/google-cloud-go/pull/11519, the cloud storage library wraps the errors which we used to check directly. This has led to multiple asset upload errors. --- pkg/gcs/gcs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/gcs') diff --git a/pkg/gcs/gcs.go b/pkg/gcs/gcs.go index e8500ec2b..c9322b40d 100644 --- a/pkg/gcs/gcs.go +++ b/pkg/gcs/gcs.go @@ -143,7 +143,7 @@ func (c *client) DeleteFile(gcsFile string) error { return err } err = c.client.Bucket(bucket).Object(filename).Delete(c.ctx) - if err == storage.ErrObjectNotExist { + if errors.Is(err, storage.ErrObjectNotExist) { return ErrFileNotFound } return err @@ -155,7 +155,7 @@ func (c *client) FileExists(gcsFile string) (bool, error) { return false, err } _, err = c.client.Bucket(bucket).Object(filename).Attrs(c.ctx) - if err == storage.ErrObjectNotExist { + if errors.Is(err, storage.ErrObjectNotExist) { return false, nil } else if err != nil { return false, err -- cgit mrf-deployment