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)