Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for try/catch/finally in XmlActions #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Destrings2
Copy link

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

@jonesde
Copy link
Member

jonesde commented Sep 27, 2020

Most scripts don't need it, but no harm having it there. Just a couple of things:

  1. please sign the AUTHORS file like you've done in other repos
  2. the catch should also have minOccurs=0 for try/finally (yet more rare, but useful sometimes)
  3. 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants