Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

异常处理 #7

Closed
small-dream opened this issue Jul 25, 2019 · 1 comment
Closed

异常处理 #7

small-dream opened this issue Jul 25, 2019 · 1 comment

Comments

@small-dream
Copy link

small-dream commented Jul 25, 2019

我在使用中 发现 无网络情况下会奔溃 ,搜了一下
建议使用 runCatching{
}

包裹请求代码
通过 result 返回异常 做处理

@lulululbj
Copy link
Owner

我在使用中 发现 无网络情况下会奔溃 ,搜了一下
建议使用 runCatching{
}

包裹请求代码
通过 result 返回异常 做处理

老哥,心有灵犀,本地代码刚 runCatching 了一部分。在 Retrofit 的 issue 下也看到了这个问题,应该是和 Retrofit 的协程扩展有关,还没找到原因,暂时就先 runCatching 处理一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants