Skip to content

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

@slowcar

Description

@slowcar

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 microsoft/kiota-java#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions