diff --git a/framework/template/XmlActions.groovy.ftl b/framework/template/XmlActions.groovy.ftl index 62afc26d1..0597f264a 100644 --- a/framework/template/XmlActions.groovy.ftl +++ b/framework/template/XmlActions.groovy.ftl @@ -305,6 +305,19 @@ ${.node} +<#macro try> try { + <#recurse .node/> + }<#if .node["catch"]?has_content><#list .node["catch"] as catch> catch (<#if catch.@class?has_content>${catch.@class}<#else>Throwable<#if catch.@field?has_content> ${catch.@field}<#else> e) { + <#recurse catch/> + } + <#if .node["finally"]?has_content> finally { + <#recurse .node["finally"][0]/> + } + + +<#macro catch><#-- do nothing when visiting, only used explicitly inline --> +<#macro finally><#-- do nothing when visiting, only used explicitly inline --> + <#-- =================== if/when sub-elements =================== --> <#macro condition><#-- do nothing when visiting, only used explicitly inline --> diff --git a/framework/xsd/xml-actions-2.1.xsd b/framework/xsd/xml-actions-2.1.xsd index a683f58fe..fa04934b1 100644 --- a/framework/xsd/xml-actions-2.1.xsd +++ b/framework/xsd/xml-actions-2.1.xsd @@ -945,6 +945,32 @@ along with this software (see the LICENSE.md file). If not, see + + + The try element can be used to catch errors + + + + + + + + + + + The finally block is executed after the catch block + + + + + + Catches an exception + + + + + +