Skip to content

Commit

Permalink
Merge pull request ansible#14445 from marcpo/maint/display_string_cau…
Browse files Browse the repository at this point in the history
…sing_exception

Display the string which is causing an exception to be raised.
  • Loading branch information
jimi-c committed Feb 12, 2016
2 parents 1b3c669 + 0792983 commit c485981
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def _do_template(self, data, preserve_trailing_newlines=True, escape_backslashes
try:
t = myenv.from_string(data)
except TemplateSyntaxError as e:
raise AnsibleError("template error while templating string: %s" % str(e))
raise AnsibleError("template error while templating string: %s. String: %s" % (str(e), data))
except Exception as e:
if 'recursion' in str(e):
raise AnsibleError("recursive loop detected in template string: %s" % data)
Expand Down

0 comments on commit c485981

Please sign in to comment.