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 摘要。