microsoftgraph / microsoftgraph/msgraph-sdk-java

Runtimeexception is thrown if network is lost (or for any other IOException)

未关闭
#2,374 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

status:waiting-for-triage type:bug
主要语言
Java
星标
444
派生
154
平均合并
18 小时 28 分钟
30 天内合并 PR
4

描述

Describe the bug

We encountered a crash in our application due to the Graph SDK declaring ApiException, but the underlying kiota implementation throwing a RuntimeException whenever a network issue occurs:
https://github.com/microsoft/kiota-java/blob/94287cd2e04d028d46a9a27c9391766c05fde0b7/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java#L768

I created an issue on https://github.com/microsoft/kiota-java/issues/1878 but was told RuntimeException is "widely used in early stages libraries".

I would request that the Graph SDK either catches this RuntimeException and throws an ApiException or that the documentation is updated to make users of the library aware of the need to handle a RuntimeException whenever a mobile device loses connectivity.

Expected behavior

An ApiException is thrown by the graphclient if an IO error occurs

How to reproduce

activate airplane mode while using graphclient

SDK Version

6.38.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

No response

Configuration
  • OS: Android
Other information

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先检查 Kiota 实现中链接的 OkHttpRequestAdapter.java 位置以及 Graph SDK 的 ApiException 处理。使用处于飞行模式的 Android 客户端重现该故障,然后确定完成后的行为是否应针对 IO 错误抛出 ApiException,还是记录 RuntimeException workaround。

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

评估

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

把新 issue 发到你的邮箱

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