mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 00:03:10 +00:00
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
This commit is contained in:
@@ -431,7 +431,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:
|
||||
|
||||
Reference in New Issue
Block a user