diff options
author | James Cammarata <jimi@sngx.net> | 2016-12-21 11:48:18 -0600 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2016-12-21 11:49:46 -0600 |
commit | 20df246504abd69f356bf91b445ce941a5a3cb77 (patch) | |
tree | 01c534b7dbb6f2b622712d89ed6d42a00dd8e460 | |
parent | f821d3a9f64bdf6a6d4538570c54ea5483011d9c (diff) | |
download | ansible-20df246504abd69f356bf91b445ce941a5a3cb77.tar.gz |
Wrap unhandled errors from lookups in an AnsibleError
This provides better error handling, and prevents errors like KeyError
from bubbliing up to code in odd places.
Fixes #17482
(cherry picked from commit 85bbce9d6b2e0cc06642ae10fa8ff7b9c8ae5454)
-rw-r--r-- | lib/ansible/template/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/template/__init__.py b/lib/ansible/template/__init__.py index 73fe50fe8a..a662364565 100644 --- a/lib/ansible/template/__init__.py +++ b/lib/ansible/template/__init__.py @@ -417,7 +417,7 @@ class Templar: raise AnsibleUndefinedVariable(e) except Exception as e: if self._fail_on_lookup_errors: - raise + raise AnsibleError("An unhandled exception occurred while running the lookup plugin '%s'. Error was a %s, original message: %s" % (name, type(e), e)) ran = None if ran: |