1
0
mirror of https://github.com/go-kratos/kratos.git synced 2026-05-22 10:15:24 +02:00

fix(errors): code error (#1394)

This commit is contained in:
wwwhaoxu
2021-08-31 09:43:36 +08:00
committed by GitHub
parent 4536b460f1
commit df6bbaa091
+2 -2
View File
@@ -75,7 +75,7 @@ func Code(err error) int {
if err == nil {
return 200
}
if se := FromError(err); err != nil {
if se := FromError(err); se != nil {
return int(se.Code)
}
return UnknownCode
@@ -84,7 +84,7 @@ func Code(err error) int {
// Reason returns the reason for a particular error.
// It supports wrapped errors.
func Reason(err error) string {
if se := FromError(err); err != nil {
if se := FromError(err); se != nil {
return se.Reason
}
return UnknownReason