[feat] 丰富错误内容提示

This commit is contained in:
2023-12-27 13:38:55 +08:00
parent 8ed7df206b
commit 95b5b15b16
2 changed files with 19 additions and 6 deletions

View File

@@ -147,7 +147,7 @@ func NewMsgResponse(msg string, code int) contracts.HttpResponse {
}
func NewErrResponse(err *contracts.Err) contracts.HttpResponse {
return NewJsonResponse([]byte(fmt.Sprintf(`{"code": %d, "msg": %q, "errord": %q}`, err.Code, err.Msg, err.Errord)))
return NewJsonResponse([]byte(fmt.Sprintf(`{"code": %d, "msg": %q}`, err.Code, err.Error())))
}
func HttpResponse(data any) contracts.HttpResponse {