StackStorm / orquesta

Orquesta is a graph based workflow engine for StackStorm. Questions? https://github.com/StackStorm/st2/discussions
https://docs.stackstorm.com/orquesta/
Apache License 2.0
98 stars 39 forks source link

"ExpressionEvaluationException: Unable to resolve key" error should include list of available keys #158

Open blag opened 5 years ago

blag commented 5 years ago

Orquesta/Jinja/YAQL currently throws an error when you try to use a key that does not exist:

"YaqlEvaluationException: Unable to resolve key 'result' in expression '<% result().result.output %>' from context."

But this leaves you guessing as to what valid keys you can use.

It would greatly ease workflow development if we dumped a list of valid keys in the error message:

"YaqlEvaluationException: Unable to resolve key 'result' in expression '<% result().result.output %>' from context; must be one of 'option1', 'option2', or 'option3'."

But if we want to avoid l10n/i18n issues with lists (I'm also not sure we handle this at all), we can also simply dump an array of options:

"YaqlEvaluationException: Unable to resolve key 'result' in expression '<% result().result.output %>' from context; must be one of ['option1', 'option2', 'option3']."
ghost commented 4 years ago

Try to place output before the result like <% result().output.result %>