service: get status error even if it is wrapped

This commit is contained in:
Evgeniy Kulikov 2019-11-26 14:08:52 +03:00
parent b6de95b740
commit d08f5a5811
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2

View file

@ -2,6 +2,7 @@ package service
import ( import (
"github.com/nspcc-dev/neofs-proto/internal" "github.com/nspcc-dev/neofs-proto/internal"
"github.com/pkg/errors"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
@ -101,7 +102,7 @@ func ProcessRequestTTL(req MetaHeader, cond ...TTLCondition) error {
// check specific condition: // check specific condition:
if err := cond[i](ttl); err != nil { if err := cond[i](ttl); err != nil {
if st, ok := status.FromError(err); ok { if st, ok := status.FromError(errors.Cause(err)); ok {
return st.Err() return st.Err()
} }