Skip to content

Commit 94d4233

Browse files
committed
fix: Include error messages when there is a problem parsing provider or state store config when getting a backend from a planfile
1 parent 508ca1e commit 94d4233

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/command/meta_backend.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,11 @@ func (m *Meta) BackendForLocalPlan(plan *plans.Plan) (backendrun.OperationsBacke
427427
&hcl.Diagnostic{
428428
Severity: hcl.DiagError,
429429
Summary: "Error reading provider configuration state",
430-
Detail: fmt.Sprintf("Terraform experienced an error reading provider configuration for provider %s (%q) while configuring state store %s",
430+
Detail: fmt.Sprintf("Terraform experienced an error reading provider configuration for provider %s (%q) while configuring state store %s: %s",
431431
settings.Provider.Source.Type,
432432
settings.Provider.Source,
433433
settings.Type,
434+
err,
434435
),
435436
},
436437
)
@@ -444,10 +445,11 @@ func (m *Meta) BackendForLocalPlan(plan *plans.Plan) (backendrun.OperationsBacke
444445
&hcl.Diagnostic{
445446
Severity: hcl.DiagError,
446447
Summary: "Error reading state store configuration state",
447-
Detail: fmt.Sprintf("Terraform experienced an error reading state store configuration for state store %s in provider %s (%q)",
448+
Detail: fmt.Sprintf("Terraform experienced an error reading state store configuration for state store %s in provider %s (%q): %s",
448449
settings.Type,
449450
settings.Provider.Source.Type,
450451
settings.Provider.Source,
452+
err,
451453
),
452454
},
453455
)

0 commit comments

Comments
 (0)