{ // irrelevant, as catch happens -6ren">
gpt4 book ai didi

javascript - 为什么 fetch 会返回 "TypeError: Failed to fetch"而不仅仅是 "Failed to fetch"?

转载 作者:行者123 更新时间:2023-12-02 22:18:15 37 4
gpt4 key购买 nike

我正在运行此代码并在没有互联网连接的情况下进行测试:

fetch(url, options)
.then(res => {
// irrelevant, as catch happens immediately on no network connection
})
.catch(err => {
console.log('Failed fetch ', err);
});

“类型错误”是什么意思?

最佳答案

关于javascript - 为什么 fetch 会返回 "TypeError: Failed to fetch"而不仅仅是 "Failed to fetch"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59317819/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com