From 5129f2a58b0cdf187f226420655696ce6d0704c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F=E4=B9=90?= Date: Tue, 14 Mar 2023 14:42:52 +0800 Subject: [PATCH] x --- transport/http/codec.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transport/http/codec.go b/transport/http/codec.go index b1636ac..e198ee6 100644 --- a/transport/http/codec.go +++ b/transport/http/codec.go @@ -78,7 +78,8 @@ func DefaultResponseEncoder(w http.ResponseWriter, r *http.Request, v any) error func DefaultErrorEncoder(w http.ResponseWriter, r *http.Request, err error) { fmt.Println("DefaultErrorEncoder") se := errors.FromError(err) - codec, _ := CodeForRequest(r, "Accept") + codec, ok := CodeForRequest(r, "Accept") + fmt.Println(ok) body, err := codec.Marshal(se) if err != nil { w.WriteHeader(http.StatusInternalServerError)