Raising AnsibleError exceptions inside the run() method of LookupModule class does not work as expected

Hi Petros,

We’d need to see code about what you are referring to to know whether this was a thing or not.

Thanks!

–Michael

Oh inside a lookup plugin?

Yeah those catch exceptions because the variables in them can be very late-binding.

The question as to whether that needs to include AnsibleError and can be done better, possibly just at the Jinja2 level, may be up for revision.

Oh I’d agree.

The question is mostly of how they can catch issues with unbound variables and leave those unfiltered, but also still allow direct exception raising.

“BTW, I saw a ‘v2’ directory, which looks like the start of a rewrite?”

More or less. Some refactoring is going to be required in order to make ansible more easy to manage and adapt for new language features - and undo some of the damage of taking many thousand pull requests that have impacted coherency. We’re still finding our footing with what this specifically will look like, so I’d request people not get involved with that codebase until we indicate we’re ready.