1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-04-04 20:44:27 +02:00

optimize the process of switching grpc error to micro error (#2158)

This commit is contained in:
Scout Wang 2021-04-29 20:03:40 +08:00 committed by GitHub
parent b11a2f17e9
commit 1b5d372b5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,5 +33,10 @@ func microError(err error) error {
}
// fallback
return errors.InternalServerError("go.micro.client", s.Message())
return &errors.Error{
Id: "go.micro.client",
Code: int32(s.Code()),
Detail: s.Message(),
Status: s.Code().String(),
}
}