From 363c11da10bfbbc8422eb5b54bf0638f71e20f24 Mon Sep 17 00:00:00 2001 From: nyagamunene Date: Wed, 12 Jun 2024 20:23:39 +0300 Subject: [PATCH] Refactor: Reverted back to original errors.Contains Signed-off-by: nyagamunene --- pkg/errors/errors.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/errors/errors.go b/pkg/errors/errors.go index e8a32e9d9e..51cdf93c32 100644 --- a/pkg/errors/errors.go +++ b/pkg/errors/errors.go @@ -81,11 +81,12 @@ func Contains(e1, e2 error) bool { if ce.Msg() == e2.Error() { return true } - return errors.Is(ce.Err(), e2) + return Contains(ce.Err(), e2) } - return errors.Is(e1, e2) + return e1.Error() == e2.Error() } + // Wrap returns an Error that wrap err with wrapper. func Wrap(wrapper, err error) Error { if wrapper == nil || err == nil {