From 51741f39eaef6770394a16be586ab7ef3b8171fd Mon Sep 17 00:00:00 2001 From: nikkiing <1031497516@qq.com> Date: Mon, 27 Feb 2023 15:19:27 +0800 Subject: [PATCH] =?UTF-8?q?http=E9=94=99=E8=AF=AF=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transport/v1/http/codec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/v1/http/codec.go b/transport/v1/http/codec.go index 62f01d7..b0140ec 100644 --- a/transport/v1/http/codec.go +++ b/transport/v1/http/codec.go @@ -44,7 +44,7 @@ func ResponseEncoder(w stdhttp.ResponseWriter, r *stdhttp.Request, v interface{} func ErrorEncoderPro(w stdhttp.ResponseWriter, r *stdhttp.Request, err error) { se := errors.FromError(err) - if !errors.Is(err, &errors.Error{}) { + if _, ok := err.(*errors.Error); !ok { se.Reason = "InternalServerError" se.Code = stdhttp.StatusInternalServerError se.Message = "internal server error"