-
Notifications
You must be signed in to change notification settings - Fork 144
Description
Describe the bug
We run an outlook calendar integration through Graph API, using msgraph-sdk-java.
When syncing calendar items to our internal DB we fetch an existing event with code:
graphClient.me().events().byEventId(id).get(rc -> addStandardOutlookRequestHeaders(rc.headers));
Today, we experienced some issues, possibly related to MS365 Issue ID MO941162. See stacktrace below
Expected behavior
Unexpected response from the API should be handled by the SDK properly and not throw a raw RuntimeException.
Other errors throw a kiota ApiException which might be fitting here
How to reproduce
Since the issue seems to be intermittent, we have not been able to reproduce it. Possibly setting up a proxy server that returns html instead of JSON might provoke the same behaviour.
SDK Version
6.20.0
Latest version known to work for scenario above?
6.20.0
Known Workarounds
Catch and parse exception message and retry the request.
Debug output
Click to expand log
``` The request above resulted in the following stacktrace:java.lang.RuntimeException: Content type text/html does not have a factory to be parsed
at com.microsoft.kiota.serialization.ParseNodeFactoryRegistry.getParseNode(ParseNodeFactoryRegistry.java:56)
at com.microsoft.kiota.http.OkHttpRequestAdapter.getRootParseNode(OkHttpRequestAdapter.java:582)
at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:649)
at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:280)
at com.microsoft.graph.users.item.events.item.EventItemRequestBuilder.get(EventItemRequestBuilder.java:176)
... internal code stack here
</details>
### Configuration
Linux: x64
Java 21
### Other information
_No response_