Skip to content

Commit 0870bcc

Browse files
improve error messages
1 parent 459c919 commit 0870bcc

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

internal/terraform/node_action.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ type nodeExpandActionDeclaration struct {
3030
}
3131

3232
var (
33-
_ GraphNodeConfigAction = (*nodeExpandActionDeclaration)(nil)
34-
_ GraphNodeReferenceable = (*nodeExpandActionDeclaration)(nil)
35-
_ GraphNodeReferencer = (*nodeExpandActionDeclaration)(nil)
36-
_ GraphNodeDynamicExpandable = (*nodeExpandActionDeclaration)(nil)
37-
_ GraphNodeProviderConsumer = (*nodeExpandActionDeclaration)(nil)
33+
_ GraphNodeConfigAction = (*nodeExpandActionDeclaration)(nil)
34+
_ GraphNodeReferenceable = (*nodeExpandActionDeclaration)(nil)
35+
_ GraphNodeReferencer = (*nodeExpandActionDeclaration)(nil)
36+
_ GraphNodeDynamicExpandable = (*nodeExpandActionDeclaration)(nil)
37+
_ GraphNodeProviderConsumer = (*nodeExpandActionDeclaration)(nil)
38+
_ GraphNodeAttachActionSchema = (*nodeExpandActionDeclaration)(nil)
3839
)
3940

4041
func (n *nodeExpandActionDeclaration) Name() string {
@@ -54,7 +55,7 @@ func (n *nodeExpandActionDeclaration) ModulePath() addrs.Module {
5455
return n.Addr.Module
5556
}
5657

57-
// GraphNodeAttachActionSchema impl
58+
// GraphNodeAttachActionSchema
5859
func (n *nodeExpandActionDeclaration) AttachActionSchema(schema *providers.ActionSchema) {
5960
n.Schema = schema
6061
}

internal/terraform/node_action_apply.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func invokeActions(ctx EvalContext, actionInvocations []*plans.ActionInvocationI
6969
if err != nil {
7070
diags = diags.Append(tfdiags.Sourceless(
7171
tfdiags.Error,
72-
"Failed to get provider",
72+
fmt.Sprintf("Failed to get provider for %s", ai.Addr),
7373
fmt.Sprintf("Failed to get provider: %s", err),
7474
))
7575
return diags

internal/terraform/node_action_instance.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ type NodeActionDeclarationInstance struct {
2828
}
2929

3030
var (
31-
_ GraphNodeModuleInstance = (*NodeActionDeclarationInstance)(nil)
32-
_ GraphNodeExecutable = (*NodeActionDeclarationInstance)(nil)
33-
_ GraphNodeReferencer = (*NodeActionDeclarationInstance)(nil)
34-
_ GraphNodeReferenceable = (*NodeActionDeclarationInstance)(nil)
31+
_ GraphNodeModuleInstance = (*NodeActionDeclarationInstance)(nil)
32+
_ GraphNodeExecutable = (*NodeActionDeclarationInstance)(nil)
33+
_ GraphNodeReferencer = (*NodeActionDeclarationInstance)(nil)
34+
_ GraphNodeReferenceable = (*NodeActionDeclarationInstance)(nil)
35+
_ GraphNodeProviderConsumer = (*NodeActionDeclarationInstance)(nil)
3536
)
3637

3738
func (n *NodeActionDeclarationInstance) Name() string {
@@ -60,7 +61,7 @@ func (n *NodeActionDeclarationInstance) Execute(ctx EvalContext, _ walkOperation
6061
if err != nil {
6162
diags = diags.Append(tfdiags.Sourceless(
6263
tfdiags.Error,
63-
"Failed to get provider",
64+
fmt.Sprintf("Failed to get provider for %s", n.Addr),
6465
fmt.Sprintf("Failed to get provider: %s", err),
6566
))
6667
return diags

0 commit comments

Comments
 (0)