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

adds better error handling when conditional fails (#17839)

When the conditional cannot extract a value from the result string,
an unhandled exception would be raised.  This fix now gracefully handles
the exception
This commit is contained in:
Peter Sprygada 2016-09-30 16:25:40 -04:00 committed by GitHub
parent 9faf56a345
commit 5b4f3b1eda

View file

@ -228,7 +228,7 @@ class Conditional(object):
if self.encoding in ['json', 'text']:
try:
return self.get_json(result)
except (IndexError, TypeError):
except (IndexError, TypeError, AttributeError):
msg = 'unable to apply conditional to result'
raise FailedConditionalError(msg, self.raw)