moqui-framework
moqui-framework copied to clipboard
Add support for try/catch/finally in XmlActions
XmlActions does not have try/catch/finally tags. This is trivial to workaround using a script tag. The codebase itself does it in Wikiservices.xml and SystemMessageServices.xml. I reckon this change might have been considered before, so are there any reasons we don't have try/catch/finally tags? It should help reducing the usage of script tags and it's syntactially easier to read as if doesn't require code-switching
Most scripts don't need it, but no harm having it there. Just a couple of things:
- please sign the AUTHORS file like you've done in other repos
- the catch should also have minOccurs=0 for try/finally (yet more rare, but useful sometimes)
- define the catch and finally elements under the try element instead of separate with a ref (have been slowly moving more toward this for better scoping of element defs, and various XML editors handle autocomplete suggestions better, have noticed even IntelliJ shows elements that aren't allowed or applicable sometimes, because they are defined globally)