1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #14445 from marcpo/maint/display_string_causing_exception

Display the string which is causing an exception to be raised.
This commit is contained in:
James Cammarata 2016-02-11 22:50:43 -05:00
commit c485981d1a

View file

@ -464,7 +464,7 @@ class Templar:
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)