Skip to content

Commit

Permalink
add logging of template errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jkhsjdhjs committed Jul 19, 2023
1 parent dc23992 commit 7415356
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def substitute_config_template(self, config_key: str, variables: Dict) -> Union[
try:
return jinja2.Template(self.config[config_key]).render(variables)
except (jinja2.TemplateSyntaxError, jinja2.UndefinedError) as e:
return Response(status=500, text=f"Error in {config_key} template: {e}")
error_message = f"Error in {config_key} template: {e}"
self.log.error(error_message)
return Response(status=500, text=error_message)

async def handle_request(self, req: Request) -> Response:
self.log.debug(f"Got request {req}")
Expand Down

0 comments on commit 7415356

Please sign in to comment.