File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
sdk/core/azure-core-http-okhttp
src/main/java/com/azure/core/http/okhttp/implementation Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 55<suppressions >
66 <suppress files =" com.azure.core.http.okhttp.OkHttpAsyncHttpClientBuilder.java" checks =" io.clientcore.linting.extensions.checkstyle.checks.ExternalDependencyExposedCheck" />
77 <suppress files =" com.azure.core.http.okhttp.OkHttpAsyncHttpClientBuilder.java" checks =" io.clientcore.linting.extensions.checkstyle.checks.ServiceClientBuilderCheck" />
8+ <suppress files =" com.azure.core.http.okhttp.implementation.OkHttpFluxRequestBody.java" checks =" io.clientcore.linting.extensions.checkstyle.checks.ThrowFromClientLoggerCheck" />
89</suppressions >
Original file line number Diff line number Diff line change @@ -83,15 +83,23 @@ public void writeTo(BufferedSink bufferedSink) throws IOException {
8383 }
8484 }, 1 , 1 ).then ();
8585
86- // The blocking happens on OkHttp thread pool.
87- if (callTimeoutMillis > 0 ) {
88- /*
89- * Default call timeout (in milliseconds). By default there is no timeout for complete calls, but
90- * there is for the connection, write, and read actions within a call.
91- */
92- requestSendMono .block (Duration .ofMillis (callTimeoutMillis ));
93- } else {
94- requestSendMono .block ();
86+ try {
87+ // The blocking happens on OkHttp thread pool.
88+ if (callTimeoutMillis > 0 ) {
89+ /*
90+ * Default call timeout (in milliseconds). By default there is no timeout for complete calls, but
91+ * there is for the connection, write, and read actions within a call.
92+ */
93+ requestSendMono .block (Duration .ofMillis (callTimeoutMillis ));
94+ } else {
95+ requestSendMono .block ();
96+ }
97+ } catch (RuntimeException e ) {
98+ if (e .getCause () instanceof IOException ) {
99+ throw (IOException ) e .getCause ();
100+ } else {
101+ throw e ;
102+ }
95103 }
96104 } else {
97105 // Prevent OkHttp from potentially re-sending non-repeatable body outside of retry policies.
You can’t perform that action at this time.
0 commit comments