From dbde7fb10ff140f6116fcd96bd3e271646955638 Mon Sep 17 00:00:00 2001 From: Even Holthe Date: Fri, 28 Jun 2019 09:07:12 +0200 Subject: [PATCH] graph/group: wrap errors --- azuread/helpers/graph/group.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azuread/helpers/graph/group.go b/azuread/helpers/graph/group.go index ff5215dd4c..68308e4159 100644 --- a/azuread/helpers/graph/group.go +++ b/azuread/helpers/graph/group.go @@ -57,7 +57,7 @@ func GroupAddMember(client graphrbac.GroupsClient, ctx context.Context, groupId log.Printf("[DEBUG] Adding member with id %q to Azure AD group with id %q", member, groupId) if _, err := client.AddMember(ctx, groupId, properties); err != nil { - return err + return fmt.Errorf("Error adding group member %q to Azure AD Group with ID %q: %+v", member, groupId, err) } return nil @@ -68,7 +68,7 @@ func GroupAddMembers(client graphrbac.GroupsClient, ctx context.Context, groupId err := GroupAddMember(client, ctx, groupId, memberUuid) if err != nil { - return err + return fmt.Errorf("Error while adding members to Azure AD Group with ID %q: %+v", groupId, err) } }