From a789c6d7c4945a4b84c6da6b9eedcccbbbf6821a Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 20 Oct 2020 15:12:49 +0200 Subject: [PATCH] add error check Signed-off-by: David Christofas --- internal/grpc/services/gateway/usershareprovider.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/grpc/services/gateway/usershareprovider.go b/internal/grpc/services/gateway/usershareprovider.go index 9e87731b97..35ef3960b2 100644 --- a/internal/grpc/services/gateway/usershareprovider.go +++ b/internal/grpc/services/gateway/usershareprovider.go @@ -205,10 +205,15 @@ func (s *svc) UpdateShare(ctx context.Context, req *collaboration.UpdateShareReq updateGrantStatus, err := s.updateGrant(ctx, getShareRes.GetShare().GetResourceId(), getShareRes.GetShare().GetGrantee(), getShareRes.GetShare().GetPermissions().GetPermissions()) + + if err != nil { + return nil, errors.Wrap(err, "gateway: error calling updateGrant") + } + if updateGrantStatus.Code != rpc.Code_CODE_OK { return &collaboration.UpdateShareResponse{ Status: updateGrantStatus, - }, err + }, nil } }