參數
- 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>