From df6bbaa09166a3f2d9c6aed005a3844f127fcf46 Mon Sep 17 00:00:00 2001 From: wwwhaoxu <53362740+wwwhaoxu@users.noreply.github.com> Date: Tue, 31 Aug 2021 09:43:36 +0800 Subject: [PATCH] fix(errors): code error (#1394) --- errors/errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/errors/errors.go b/errors/errors.go index 01a492d7f..2f561d075 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -75,7 +75,7 @@ func Code(err error) int { if err == nil { return 200 } - if se := FromError(err); err != nil { + if se := FromError(err); se != nil { return int(se.Code) } return UnknownCode @@ -84,7 +84,7 @@ func Code(err error) int { // Reason returns the reason for a particular error. // It supports wrapped errors. func Reason(err error) string { - if se := FromError(err); err != nil { + if se := FromError(err); se != nil { return se.Reason } return UnknownReason