Skip to content

Commit

Permalink
[Resolves #1267] Improve the Stack Config Jinja Error Message to incl…
Browse files Browse the repository at this point in the history
…ude the Stack Name (#1269)

Improves the stack config Jinja error message to include the stack name.

### Original Error Message

```
'foo2' is undefined
```

### New Error Message

```
dev/stack.yaml - 'foo2' is undefined
```
  • Loading branch information
X-Guardian authored Jan 20, 2023
1 parent e68c13d commit 7adf346
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions sceptre/config/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,17 @@ def _render(self, directory_path, basename, stack_group_config):
) from err

self.templating_vars.update(stack_group_config)
rendered_template = template.render(
self.templating_vars,
command_path=self.context.command_path.split(path.sep),
environment_variable=environ,
)

try:
rendered_template = template.render(
self.templating_vars,
command_path=self.context.command_path.split(path.sep),
environment_variable=environ,
)
except Exception as err:
raise SceptreException(
f"{Path(directory_path, basename).as_posix()} - {err}"
) from err

try:
config = yaml.safe_load(rendered_template)
Expand Down

0 comments on commit 7adf346

Please sign in to comment.