Skip to content

Commit

Permalink
add failure reason to Device Unreachability Warning in l3handoff
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-mazurkiewicz committed Nov 29, 2024
1 parent e8aa354 commit f41d0b1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f41d0b1

Please sign in to comment.