fix(errors): code error (#1394)

pull/1396/head
wwwhaoxu 3 years ago committed by GitHub
parent 4536b460f1
commit df6bbaa091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      errors/errors.go

@ -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

Loading…
Cancel
Save