Skip to content

Commit a56a475

Browse files
committed
Update with correct diag returns
1 parent 43b7acf commit a56a475

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

resource/import_state.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ func ImportStatePassthroughID(ctx context.Context, attrPath path.Path, req Impor
107107
"This is always an error in the provider. Please report the following to the provider developer:\n\n"+
108108
"Resource ImportState method call to ImportStatePassthroughID path must be set to a valid attribute path that can accept a string value.",
109109
)
110+
return
110111
}
111112

112113
// If the import is using the ID string identifier, (either via the "terraform import" CLI command, or a config block with the "id" attribute set)
@@ -141,6 +142,10 @@ func ImportStatePassthroughWithIdentity(ctx context.Context, stateAttrPath, iden
141142
)
142143
}
143144

145+
if resp.Diagnostics.HasError() {
146+
return
147+
}
148+
144149
// If the import is using the import identifier, (either via the "terraform import" CLI command, or a config block with the "id" attribute set)
145150
// pass through the ID to the designated state attribute.
146151
if req.ID != "" {

0 commit comments

Comments
 (0)