mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07: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:
parent
9faf56a345
commit
5b4f3b1eda
1 changed files with 1 additions and 1 deletions
|
@ -228,7 +228,7 @@ class Conditional(object):
|
||||||
if self.encoding in ['json', 'text']:
|
if self.encoding in ['json', 'text']:
|
||||||
try:
|
try:
|
||||||
return self.get_json(result)
|
return self.get_json(result)
|
||||||
except (IndexError, TypeError):
|
except (IndexError, TypeError, AttributeError):
|
||||||
msg = 'unable to apply conditional to result'
|
msg = 'unable to apply conditional to result'
|
||||||
raise FailedConditionalError(msg, self.raw)
|
raise FailedConditionalError(msg, self.raw)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue