client: make IsErrNotFound an alias for errdefs.IsNotFound

None of the client will return the old error-types, so there's no need
to keep the compatibility code. We can consider deprecating this function
in favor of the errdefs equivalent this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-05-10 13:36:19 +02:00
parent f70d9933d1
commit 685b3d820a
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -31,20 +31,10 @@ func ErrorConnectionFailed(host string) error {
return errConnectionFailed{host: host}
}
// Deprecated: use the errdefs.NotFound() interface instead. Kept for backward compatibility
type notFound interface {
error
NotFound() bool
}
// IsErrNotFound returns true if the error is a NotFound error, which is returned
// by the API when some object is not found.
// by the API when some object is not found. It is an alias for [errdefs.IsNotFound].
func IsErrNotFound(err error) bool {
if errdefs.IsNotFound(err) {
return true
}
var e notFound
return errors.As(err, &e)
return errdefs.IsNotFound(err)
}
type objectNotFoundError struct {