From 44333afd20a6312b617e0c33a497a4385ba3a250 Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Sun, 27 Nov 2022 15:53:26 +0800 Subject: chore: consistently use `errors.Cause` for identifying error types (#7264) --- internal/db/email_addresses.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'internal/db/email_addresses.go') diff --git a/internal/db/email_addresses.go b/internal/db/email_addresses.go index 8cef705e..4f30a898 100644 --- a/internal/db/email_addresses.go +++ b/internal/db/email_addresses.go @@ -45,6 +45,8 @@ type ErrEmailNotExist struct { args errutil.Args } +// IsErrEmailAddressNotExist returns true if the underlying error has the type +// ErrEmailNotExist. func IsErrEmailAddressNotExist(err error) bool { _, ok := errors.Cause(err).(ErrEmailNotExist) return ok -- cgit v1.2.3