2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00

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

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.