docs: clarify task example ownership and failure boundaries

This commit is contained in:
2026-11-12 21:22:00 +08:00
parent 40b43ac3c3
commit 94e0f96e4a
6 changed files with 11 additions and 4 deletions
+1
View File
@@ -19,6 +19,7 @@ class TextFetcher {
function fetch(self: TextFetcher, url: String): Unit {
// url 来自显式 fetch 调用,HTTP(S) GET 由后台 provider 完成;新句柄返回不代表网络已完成。
self.task = ui.fetchText(self, "request", url, self.apply)
// 只有 fetchText 成功创建新句柄才清旧结果;若 URL 校验/任务额度拒绝,上面的调用报错,下面不会执行。
// 同步清旧结果,避免新请求等待期间让 Console 把旧响应误认成新请求结果。
self.response = ""
self.output.text = ""