Skip to content

Commit bf66e42

Browse files
committed
check diags
1 parent ae9e584 commit bf66e42

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

internal/provider/allocation_resource.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ func (r *allocationResource) Read(ctx context.Context, req resource.ReadRequest,
124124
)
125125
return
126126
}
127-
state.populate(allocation, ctx)
127+
diags = state.populate(allocation, ctx)
128+
resp.Diagnostics.Append(diags...)
129+
if resp.Diagnostics.HasError() {
130+
return
131+
}
128132

129133
// Set refreshed state
130134
diags = resp.State.Set(ctx, &state)
@@ -178,7 +182,11 @@ func (r *allocationResource) Update(ctx context.Context, req resource.UpdateRequ
178182
)
179183
return
180184
}
181-
state.populate(allocationResponse, ctx)
185+
diags = state.populate(allocationResponse, ctx)
186+
resp.Diagnostics.Append(diags...)
187+
if resp.Diagnostics.HasError() {
188+
return
189+
}
182190

183191
// Set refreshed state
184192
diags = resp.State.Set(ctx, &state)

0 commit comments

Comments
 (0)