From cf73eae29c9d7881a461f132ae3d13ab2c95c7d7 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:44:08 +0800 Subject: [PATCH] x --- transport/http/codec.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/http/codec.go b/transport/http/codec.go index e198ee6..e7ec968 100644 --- a/transport/http/codec.go +++ b/transport/http/codec.go @@ -78,8 +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, ok := CodeForRequest(r, "Accept") - fmt.Println(ok) + codec, _ := CodeForRequest(r, "Accept") + codec = encoding.GetCodec("xml") body, err := codec.Marshal(se) if err != nil { w.WriteHeader(http.StatusInternalServerError)