client/grpc: fix error panic (#1860)

This commit is contained in:
ben-toogood 2020-07-20 10:04:51 +01:00 committed by GitHub
parent 592179c0a2
commit a3a7434f2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,9 @@ func microError(err error) error {
// return first error from details // return first error from details
if details := s.Details(); len(details) > 0 { if details := s.Details(); len(details) > 0 {
return microError(details[0].(error)) if verr, ok := details[0].(error); ok {
return microError(verr)
}
} }
// try to decode micro *errors.Error // try to decode micro *errors.Error