github-tools / github-tools/github

Cannot read property 'status' of undefined error when there is no network

未关闭
#439 1 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
JavaScript
星标
3.8k
派生
809
PR 合并指标
30 天内没有已合并 PR

描述

When there is no network the `_request` function fails, without rejecting the Promise, which makes impossible to catch the error when using a callback.

Even though the component can't be used without the network (#388), I think would be good to handle the case.

The error:

`TypeError: Cannot read property 'status' of undefined`

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先定位 `_request` 函数,并复现 issue 中描述的无网络情况。检查 issue #388 中的相关上下文,然后确保失败的请求 reject 其 Promise,以便 callback 用户能够捕获错误;当未定义的 `status` 错误得到处理而不是逸出时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
api
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。