fix: grpc status in sentry and validation interceptors (#2012)

This commit is contained in:
Livio Amstutz
2021-07-13 15:42:41 +02:00
committed by GitHub
parent da181b9e8c
commit 87ef8f454a
3 changed files with 16 additions and 6 deletions

View File

@@ -4,6 +4,8 @@ import (
"context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
_ "github.com/caos/zitadel/internal/statik"
)
@@ -25,7 +27,7 @@ func validate(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
}
err := validate.Validate()
if err != nil {
return nil, err
return nil, status.Error(codes.InvalidArgument, err.Error())
}
return handler(ctx, req)
}