Skip to content

Commit 8a62569

Browse files
committed
chore: improved erorr reporting
1 parent 1e41ed3 commit 8a62569

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

pkg/config/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,10 @@ func ParseConfig(
13881388
}
13891389

13901390
if terragruntConfigFile == nil {
1391-
return nil, errors.New(CouldNotResolveTerragruntConfigInFileError(file.ConfigPath))
1391+
// Surface the eval / decode errors accumulated above alongside the wrapper
1392+
// so callers see the actual cause and not just "Could not find ...".
1393+
errs = errs.Append(errors.New(CouldNotResolveTerragruntConfigInFileError(file.ConfigPath)))
1394+
return nil, errs.ErrorOrNil()
13921395
}
13931396

13941397
config, err := convertToTerragruntConfig(ctx, pctx, file.ConfigPath, terragruntConfigFile)

pkg/config/config_helpers.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,16 @@ func ParseTerragruntConfig(ctx context.Context, pctx *ParsingContext, l log.Logg
10321032
// Track that this file was read during parsing
10331033
trackFileRead(pctx.FilesRead, path)
10341034

1035+
l.Debugf("read_terragrunt_config target=%s caller=%s original=%s workingDir=%s skipOutput=%t skipOutputsResolution=%t decodedDeps=%t",
1036+
targetConfig,
1037+
pctx.TerragruntConfigPath,
1038+
pctx.OriginalTerragruntConfigPath,
1039+
pctx.WorkingDir,
1040+
pctx.SkipOutput,
1041+
pctx.SkipOutputsResolution,
1042+
pctx.DecodedDependencies != nil,
1043+
)
1044+
10351045
// We update the ctx of terragruntOptions to the config being read in.
10361046
l, pctx, err := pctx.WithConfigPath(l, targetConfig)
10371047
if err != nil {

0 commit comments

Comments
 (0)