> ## 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 从脚本中抛出错误（异常），并提供标识代码以及可选的描述和详细信息。

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

## 参数

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

## 控制属性

无

## 示例

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

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

## 另请参阅

* [arc:try](https://docs.kasoftware.com/26.4/self-hosted/zh/scripting/keyword-reference/op-arc-try.md)：定义用于捕获异常的作用域。
* [arc:catch](https://docs.kasoftware.com/26.4/self-hosted/zh/scripting/keyword-reference/op-arc-catch.md)：捕获抛出的异常并定义异常处理。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.