GraphClient me().events().byEventid(...) throws RuntimeException on unexpected request response type text/html #2234
Labels
status:waiting-for-triage
An issue that is yet to be reviewed or assigned
type:bug
A broken experience
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 belowExpected 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 hereHow 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
The text was updated successfully, but these errors were encountered: