service: ProcessRequestTTL shouldn't change status errors

This commit is contained in:
Evgeniy Kulikov 2019-11-25 15:47:57 +03:00
parent 28628d3b52
commit 5c031fc6b2
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
2 changed files with 23 additions and 12 deletions

View file

@ -101,6 +101,10 @@ func ProcessRequestTTL(req MetaHeader, cond ...TTLCondition) error {
// check specific condition:
if err := cond[i](ttl); err != nil {
if st, ok := status.FromError(err); ok {
return st.Err()
}
return status.New(codes.InvalidArgument, err.Error()).Err()
}
}