From 5b89f75c863dfefc3f1699b1454fe1d60a267b1f Mon Sep 17 00:00:00 2001 From: Chris Marget Date: Sun, 20 Oct 2024 14:06:16 -0400 Subject: [PATCH] expand error text --- ...rce_datacenter_connectivity_template_assignments.go | 4 ++-- ...rce_datacenter_connectivity_templates_assignment.go | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apstra/resource_datacenter_connectivity_template_assignments.go b/apstra/resource_datacenter_connectivity_template_assignments.go index 192c6217..b1ab5f57 100644 --- a/apstra/resource_datacenter_connectivity_template_assignments.go +++ b/apstra/resource_datacenter_connectivity_template_assignments.go @@ -78,7 +78,7 @@ func (o *resourceDatacenterConnectivityTemplateAssignments) Create(ctx context.C err = bp.SetApplicationPointsConnectivityTemplates(ctx, request) if err != nil { resp.Diagnostics.AddError( - fmt.Sprintf("failed while assigning Connectivity Template %s to Application Points", plan.ConnectivityTemplateId), + fmt.Sprintf("failed while assigning Connectivity Template %s to Application Points %s", plan.ConnectivityTemplateId, plan.ApplicationPointIds), err.Error()) } @@ -182,7 +182,7 @@ func (o *resourceDatacenterConnectivityTemplateAssignments) Update(ctx context.C err = bp.SetApplicationPointsConnectivityTemplates(ctx, request) if err != nil { resp.Diagnostics.AddError( - fmt.Sprintf("failed while assigning Connectivity Template %s to Application Points", plan.ConnectivityTemplateId), + fmt.Sprintf("failed while assigning Connectivity Template %s to Application Points %s", plan.ConnectivityTemplateId, plan.ApplicationPointIds), err.Error()) } diff --git a/apstra/resource_datacenter_connectivity_templates_assignment.go b/apstra/resource_datacenter_connectivity_templates_assignment.go index 18d0b60c..ca9a1c08 100644 --- a/apstra/resource_datacenter_connectivity_templates_assignment.go +++ b/apstra/resource_datacenter_connectivity_templates_assignment.go @@ -71,7 +71,10 @@ func (o *resourceDatacenterConnectivityTemplatesAssignment) Create(ctx context.C addIds, _ := plan.AddDelRequest(ctx, nil, &resp.Diagnostics) err = bp.SetApplicationPointConnectivityTemplates(ctx, apstra.ObjectId(plan.ApplicationPointId.ValueString()), addIds) if err != nil { - resp.Diagnostics.AddError("failed applying Connectivity Template", err.Error()) + resp.Diagnostics.AddError( + fmt.Sprintf("failed while assigning Connectivity Templates %s to Application Point %s", plan.ConnectivityTemplateIds, plan.ApplicationPointId), + err.Error(), + ) return } @@ -178,7 +181,10 @@ func (o *resourceDatacenterConnectivityTemplatesAssignment) Update(ctx context.C // add any required CTs err = bp.SetApplicationPointConnectivityTemplates(ctx, apstra.ObjectId(plan.ApplicationPointId.ValueString()), addIds) if err != nil { - resp.Diagnostics.AddError("failed assigning connectivity templates", err.Error()) + resp.Diagnostics.AddError( + fmt.Sprintf("failed while assigning Connectivity Templates %s to Application Point %s", plan.ConnectivityTemplateIds, plan.ApplicationPointId), + err.Error(), + ) return }