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

with_sequence: pass AnsibleError through

The parsing methods try as hard as possible to generate meaningful error messages that are all ignored and immediately overwritten by a new AnsibleError instance. Better use the original one instead.
This commit is contained in:
Benoît Allard 2016-11-30 10:44:57 +01:00 committed by Toshio Kuratomi
parent 7db4ed02ee
commit 56dcf2cc04

View file

@ -187,6 +187,8 @@ class LookupModule(LookupBase):
try: try:
if not self.parse_simple_args(term): if not self.parse_simple_args(term):
self.parse_kv_args(parse_kv(term)) self.parse_kv_args(parse_kv(term))
except AnsibleError:
raise
except Exception as e: except Exception as e:
raise AnsibleError("unknown error parsing with_sequence arguments: %r. Error was: %s" % (term, e)) raise AnsibleError("unknown error parsing with_sequence arguments: %r. Error was: %s" % (term, e))