Browse code

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>

Sebastiaan van Stijn authored on 2023/05/10 20:36:19
Showing 1 changed files
... ...
@@ -31,20 +31,10 @@ func ErrorConnectionFailed(host string) error {
31 31
 	return errConnectionFailed{host: host}
32 32
 }
33 33
 
34
-// Deprecated: use the errdefs.NotFound() interface instead. Kept for backward compatibility
35
-type notFound interface {
36
-	error
37
-	NotFound() bool
38
-}
39
-
40 34
 // IsErrNotFound returns true if the error is a NotFound error, which is returned
41
-// by the API when some object is not found.
35
+// by the API when some object is not found. It is an alias for [errdefs.IsNotFound].
42 36
 func IsErrNotFound(err error) bool {
43
-	if errdefs.IsNotFound(err) {
44
-		return true
45
-	}
46
-	var e notFound
47
-	return errors.As(err, &e)
37
+	return errdefs.IsNotFound(err)
48 38
 }
49 39
 
50 40
 type objectNotFoundError struct {