gs: check against the correct error in IsNotExist

This commit is contained in:
Michael Eischer 2022-12-03 18:15:41 +01:00
parent 04d101fa94
commit 2f934f5803
1 changed files with 1 additions and 2 deletions

View File

@ -170,8 +170,7 @@ func (be *Backend) SetListMaxItems(i int) {
// IsNotExist returns true if the error is caused by a not existing file.
func (be *Backend) IsNotExist(err error) bool {
debug.Log("IsNotExist(%T, %#v)", err, err)
var gerr *googleapi.Error
return errors.As(err, &gerr) && gerr.Code == 404
return errors.Is(err, storage.ErrObjectNotExist)
}
// Join combines path components with slashes.