1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-11-06 08:59:18 +02:00

mw/log: http code 0 (#1010)

* fix middleware/log default code
This commit is contained in:
miya
2021-06-06 23:38:57 -05:00
committed by GitHub
parent 5cbda8ebd7
commit 544e08f729
5 changed files with 95 additions and 16 deletions

View File

@@ -76,7 +76,7 @@ func Errorf(code int, reason, format string, a ...interface{}) error {
// It supports wrapped errors.
func Code(err error) int {
if err == nil {
return 0
return 200
}
if se := FromError(err); err != nil {
return int(se.Code)