From f41d0b1bf3c8c5731d341e3d9ab6ecab83529d00 Mon Sep 17 00:00:00 2001 From: kuba-mazurkiewicz Date: Fri, 29 Nov 2024 10:44:49 +0100 Subject: [PATCH] add failure reason to Device Unreachability Warning in l3handoff --- .../resource_catalystcenter_fabric_l3_handoff_ip_transit.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_catalystcenter_fabric_l3_handoff_ip_transit.go b/internal/provider/resource_catalystcenter_fabric_l3_handoff_ip_transit.go index f12433a..815835c 100644 --- a/internal/provider/resource_catalystcenter_fabric_l3_handoff_ip_transit.go +++ b/internal/provider/resource_catalystcenter_fabric_l3_handoff_ip_transit.go @@ -191,7 +191,8 @@ func (r *FabricL3HandoffIPTransitResource) Create(ctx context.Context, req resou errorCode := res.Get("response.errorCode").String() if errorCode == "NCDP10000" { // Log a warning and continue execution when device is unreachable - resp.Diagnostics.AddWarning("Device Unreachability Warning", fmt.Sprintf("Device unreachability detected (error code: %s).", errorCode)) + failureReason := res.Get("response.failureReason").String() + resp.Diagnostics.AddWarning("Device Unreachability Warning", fmt.Sprintf("Device unreachability detected (error code: %s, reason %s).", errorCode, failureReason)) } else { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (%s), got error: %s, %s", "POST", err, res.String())) return