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

# arc:throw

> 使用 arc:throw 从脚本中抛出错误（异常），并提供标识代码以及可选的描述和详细信息。

export const siteNameShort = "知行之桥";

`arc:throw` 关键字用于从脚本中抛出错误（异常）。

## 参数

* **code**：用于标识异常来源或含义的字符串值。此参数是必需的。
* **desc\[ription]**：可选参数，用于指定描述错误条件的简短消息。
* **details**：可选参数，包含诊断错误时可能有用的附加信息。

## 控制属性

无

## 示例

以下示例显式定义了错误码和描述：

```xml theme={null}
<arc:throw code="myerror" desc="thedescription" />
```

## 另请参阅

* [arc:try](./op-arc-try)：定义用于捕获异常的作用域。
* [arc:catch](./op-arc-catch)：捕获抛出的异常并定义异常处理。
