Closed otusweb closed 7 years ago
Also the order of the response variables should be guaranteed due to my JMESPath query.
While it is safe to assume for now don't have a space, what happens if the query returns an error. With JSOn parser, you'll get the error bubbled right away. where I believe that with the current code, it will most likely fail silently. As for running slower, you're probably right, but i doubt that it is in a measurably significant way.
@otusweb JMESPath syntax errors will cause awscli to exit nonzero, causing the step to fail immediately. However I tried a syntactically correct nonsense query and you are correct that it does not raise an error. In text mode however, it will cause the query to return None
. So how about this... I can add an explicit check if the first field is equal to None
at which point the step will fail.
example:
$ aws devicefarm list-projects --query='foo['
Bad value for --query foo[: Invalid jmespath expression: Incomplete expression:
"foo["
^
$ echo $?
255
$ aws devicefarm list-projects --query='foobar' --output=text
None
Sounds good. Thanks for considering!
@otusweb Of course! Feel free to send more PRs in the future regarding the other issue you opened or whatever.