Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: A1lo <yin199909@aliyun.com>
  • Loading branch information
jasonren0403 and yin1999 authored Dec 12, 2024
1 parent a65f16f commit 10b2854
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions files/zh-cn/web/api/abortsignal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ async function fetchVideo() {
try {
const response = await fetch(url, { signal });
console.log("下载完毕", response);
// process response further
// 进一步处理请求
} catch (err) {
console.error(`下载出现错误:${err.message}`);
}
}
```

如果在执行 `fetch()` 调用后但在读取响应体之前中止了请求,那么尝试读取响应体时将出现 `AbortError` 异常。
如果在 `fetch()` 调用兑现后但在读取响应体之前中止了请求,那么尝试读取响应体时将出现 `AbortError` 异常。

```js
async function get() {
Expand Down Expand Up @@ -207,7 +207,7 @@ myCoolPromiseAPI({ /* …, */ signal })
controller.abort();
```

不返回 promise 的 API 接口可能会以类似的方式做出反应。在某些情况下,吸收信号可能是有意义的
不返回 promise 的 API 接口可能会以类似的方式做出反应。在某些情况下,接收信号可能是有意义的

## 规范

Expand Down

0 comments on commit 10b2854

Please sign in to comment.