diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java index b634cf7d..7083b364 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java @@ -904,7 +904,15 @@ public long contentLength() throws IOException { public void writeTo(@Nonnull BufferedSink sink) throws IOException { sink.writeAll(Okio.source(requestInfo.content)); if (!isOneShot()) { - requestInfo.content.reset(); + try { + requestInfo.content.reset(); + } catch (Exception ex) { + spanForAttributes.recordException(ex); + // we don't want to fail the request if reset() fails + // reset() was a measure to prevent draining the request + // body by an interceptor before + // the final network request + } } } };