> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:try

> arc:try をarc:catch と組み合わせてスクリプト内に例外処理ブロックを作成し、try ボディ内でスローされたRSBException をキャッチします。

export const siteNameShort = "Arc";

`arc:try` と[arc:catch](./op-arc-catch) キーワードを使用して、スクリプト内で例外処理ブロックを作成します。`arc:try` ボディ内のキーワードがRSBException をスローすると、アプリケーションは同じスコープ内で合致する`arc:catch` キーワードを探し、catch のボディを実行します。

## パラメータ

None

## アトリビュートの制御

None

## 例

例外をスローし、キャッチします。キーワードのスコープ内で、`arc:ecode` および`arc:emessage` アトリビュートが現在のアイテムに追加され、プッシュされます。

```xml theme={null}
<arc:call op="...">
  <arc:try>
    <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:try>
</arc:call>
```

## 関連項目

* [arc:catch](./op-arc-catch)：スローされた例外を処理する。
* [arc:throw](./op-arc-throw)：例外を強制する。
