errdefs: Provide a valid stack in all cases

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2017-08-22 09:39:31 -07:00
parent 0648ec3ead
commit 4de219903a
No known key found for this signature in database
GPG Key ID: 40CF16616B361216

View File

@ -73,13 +73,11 @@ func FromGRPC(err error) error {
cls = ErrUnknown
}
if cls != nil {
msg := rebaseMessage(cls, err)
if msg != "" {
err = errors.Wrapf(cls, msg)
} else {
err = cls
}
err = errors.WithStack(cls)
}
return err