diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-05-02 17:16:36 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-05-02 15:32:12 +0000 |
| commit | b0714e3765d142fe4804381880268a54cb4b984c (patch) | |
| tree | 5177a5245bae083a3ba214369d90d90ae91cfbea /pkg/gcs | |
| parent | 73d2a07be0d296d13eb834b665be7225a4f3ac9b (diff) | |
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.
Diffstat (limited to 'pkg/gcs')
| -rw-r--r-- | pkg/gcs/gcs.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
