microsoftgraph / microsoftgraph/msgraph-sdk-java
Runtimeexception is thrown if network is lost (or for any other IOException)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 444
- Forks
- 154
- Avg merge
- 18h 28m
- Merged PRs (30d)
- 4
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked OkHttpRequestAdapter.java location in the Kiota implementation and the Graph SDK's ApiException handling. Reproduce the failure with the Android client in airplane mode, then determine whether the completed behavior should surface an ApiException for IO errors or document the RuntimeException workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100