xdoer / PreQuest

A Modular And Pluggable Solution For HTTP Request.
https://pre-quest.vercel.app
MIT License
87 stars 14 forks source link

await 如何获取promise rejection ? #36

Closed 23233 closed 2 years ago

23233 commented 2 years ago

代码示例

// 发起请求
const req = await req.get("any")
// 如果断网的情况下 永远不会进入到下一步
if (req.statusCode === 200) { .... }

想要的结果

能够永远获取response 不管是成功与失败 能够走到最后而不会被半途break !

基本环境

xdoer commented 2 years ago

@23233 晚上回去看一下,应该不会出现这样的情况,因为小程序默认会超时报错

xdoer commented 2 years ago

经过验证,没发现你这样的问题。 image