> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/workflow/throw.md).

# 抛出

Throw是主动抛出您自定义的错误通知（Exception）并立即停止当前脚本流的行为。

Throw和Stop之间的核心区别在于停止流后的报告状态：

* Stop：关闭流，系统仍然记录完成的运行状态（Completed - 显示为绿色）。
* Throw：关闭流，系统将标记为错误状态（Error - 显示为红色），并将具体错误内容记录到系统日志（Log）中。

#### 实际示例：当广告账户余额不足时抛出错误

假设您正在编写自动化广告活动的脚本。在设置之前，脚本需要进入管理页面检查预算。如果余额为0，脚本将无法继续运行：

* 配置方法：
  * 使用If语句检查：`如果余额 = 0`。
  * 在If语句内部，您调用Throw动作，并填写错误通知内容为：`"错误：账户余额不足，无法创建广告！"`。
* 结果：当运行到这里时，该配置文件的流将立即关闭。在GPM Automate的进度管理面板上，该配置文件的状态将变为错误（红色），并附上错误通知的文字。您只需浏览列表即可快速筛选出哪些账户出现错误，以便处理，而不会与成功运行的流（Completed）混淆。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/workflow/throw.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
