Skip to content

Commit

Permalink
[DSW-2119] Fix Jinja2 template error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekSuchanek committed Nov 17, 2023
1 parent 5acb8c0 commit 13d473a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/dsw-document-worker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Reporting Jinja2 template syntax errors


## [4.0.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def asset_path(file_name):
content = b''
try:
content = self.j2_root_template.render(**jinja_args).encode(DEFAULT_ENCODING)
except jinja2.exceptions.TemplateSyntaxError as e:
self.raise_exc(self._jinja_exception_msg(e))
except jinja2.exceptions.TemplateRuntimeError as e:
self.raise_exc(f'Failed rendering Jinja2 template due to'
f' {type(e).__name__}\n'
Expand Down

0 comments on commit 13d473a

Please sign in to comment.