Update errors.go (#2009)

pull/2012/head
songzhibin97 3 years ago committed by GitHub
parent ef6fb480c6
commit 1dfb77bfe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      errors/errors.go

@ -131,7 +131,9 @@ func FromError(err error) *Error {
return se
}
gs, ok := status.FromError(err)
if ok {
if !ok {
return New(UnknownCode, UnknownReason, err.Error())
}
ret := New(
httpstatus.FromGRPCCode(gs.Code()),
UnknownReason,
@ -145,6 +147,4 @@ func FromError(err error) *Error {
}
}
return ret
}
return New(UnknownCode, UnknownReason, err.Error())
}

Loading…
Cancel
Save