Skip to content

Commit 5224b5e

Browse files
committed
ensure warnings are not lost
1 parent 2a82b6c commit 5224b5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/helper/plugin/grpc_provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,8 @@ func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *proto.ReadRe
541541
instanceState.Meta = private
542542

543543
newInstanceState, diags := res.RefreshWithoutUpgrade(ctx, instanceState, s.provider.Meta())
544+
resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags)
544545
if diags.HasError() {
545-
resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags)
546546
return resp, nil
547547
}
548548

@@ -1051,8 +1051,8 @@ func (s *GRPCProviderServer) ReadDataSource(ctx context.Context, req *proto.Read
10511051

10521052
// now we can get the new complete data source
10531053
newInstanceState, diags := res.ReadDataApply(ctx, diff, s.provider.Meta())
1054+
resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags)
10541055
if diags.HasError() {
1055-
resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags)
10561056
return resp, nil
10571057
}
10581058

0 commit comments

Comments
 (0)