Add additional NotFound error check for S3/Exists

This commit is contained in:
Mustafa Gezen 2023-08-28 05:22:37 +02:00
parent 8599fba8d9
commit b4cf14131e
Signed by: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -25,6 +25,7 @@ import (
"go.resf.org/peridot/base/go/storage"
"net/url"
"os"
"strings"
)
// S3 is an implementation of the Storage interface for S3.
@ -161,6 +162,9 @@ func (s *S3) Exists(object string) (bool, error) {
return false, nil
}
}
if strings.Contains(err.Error(), "NotFound") {
return false, nil
}
return false, err
}
return true, nil