Skip to content

Commit ec0c547

Browse files
committed
Add errors for missing values on reads
1 parent 2bfdfb6 commit ec0c547

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

internal/kibana/security_list/create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func (r *securityListResource) Create(ctx context.Context, req resource.CreateRe
5555

5656
if readResp == nil || readResp.JSON200 == nil {
5757
resp.State.RemoveResource(ctx)
58+
resp.Diagnostics.AddError("Failed to fetch security list", "API returned empty response")
5859
return
5960
}
6061

internal/kibana/security_list/update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func (r *securityListResource) Update(ctx context.Context, req resource.UpdateRe
6161

6262
if readResp == nil || readResp.JSON200 == nil {
6363
resp.State.RemoveResource(ctx)
64+
resp.Diagnostics.AddError("Failed to fetch security list", "API returned empty response")
6465
return
6566
}
6667

0 commit comments

Comments
 (0)