Skip to content

Commit

Permalink
Enable using errors.Is with ErrResourceDiscoveryFailed error
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Aug 29, 2024
1 parent e6c3d13 commit 944e736
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/client/apiutil/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ func (e *ErrResourceDiscoveryFailed) Unwrap() []error {
}
return subErrors
}

// Is makes it possible for the callers to use `errors.Is(` helper on errors wrapped with ErrResourceDiscoveryFailed error.
func (e *ErrResourceDiscoveryFailed) Is(target error) bool {
_, ok := target.(*ErrResourceDiscoveryFailed)
return ok
}

0 comments on commit 944e736

Please sign in to comment.