参数
- code:code 参数可以允许选择性地捕获异常。要捕获所有异常,请使用字符 *。
控制属性
- _code:捕获异常的代码。
- _description:捕获的异常的简单描述。
- _details: 关于异常的更多信息(如果有)。
示例
在批处理文件或 shell 命令的错误输出时包装一条更加用户友好型的消息:arc:ecode 和 arc:emessage属性被添加到当前的对象中并推出。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
在脚本中创建异常处理块,可选择性地或广泛地捕获 arc:try 或其它隐式 try 作用域中抛出的异常。
<arc:try>
<arc:call op="sysExecute">
<arc:check attr="sys:error">
<arc:throw code="myerror" description="Batch file could not be executed" details="[sys:error]"/>
</arc:check>
</arc:call>
<arc:catch code="*">
<arc:call op="appSendEmail"/>
</arc:catch>
</arc:try>
arc:ecode 和 arc:emessage属性被添加到当前的对象中并推出。
<arc:call op="...">
<arc:throw code="myerror" description="thedescription" details="Other Details."/>
<arc:catch code="myerror">
<arc:set attr="arc:ecode" value="[_code]"/>
<arc:set attr="arc:emessage" value="[_description]: [_details]"/>
<arc:push/>
</arc:catch>
</arc:call>
<arc:catch code="*">
An exception occurred. Code: [_code], Message: [_description]
</arc:catch>