Skip to content

Commit

Permalink
chore: update render error as it is ambiguous
Browse files Browse the repository at this point in the history
  • Loading branch information
robcxyz committed Apr 18, 2022
1 parent 5be22cd commit af874e4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tackle/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ def render_string(context: 'Context', raw: str):
raise e

except UndefinedError as e:
if len(unknown_variables) != 0:
raise UnknownTemplateVariableException(
f"Variable{'s' if len(unknown_variables) != 1 else ''} {' '.join(unknown_variables)} unknown.",
context=context,
) from None
raise e
# TODO: Make it so when dicts are used as references that the error detects that
# https://github.com/robcxyz/tackle-box/issues/68
# if len(unknown_variables) != 0:
# raise UnknownTemplateVariableException(
# f"Variable{'s' if len(unknown_variables) != 1 else ''} {' '.join(unknown_variables)} unknown.",
# context=context,
# ) from None
raise UnknownTemplateVariableException(str(e), context=context)

try:
# This will error on strings
Expand Down

0 comments on commit af874e4

Please sign in to comment.