You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2024/10/17 10:17:23 UTC

(httpcomponents-client) branch 5.4.x updated: Bug fix: Fixed propagation of runtime exceptions thrown during connection route setup

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch 5.4.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


The following commit(s) were added to refs/heads/5.4.x by this push:
     new ca5e14e4e Bug fix: Fixed propagation of runtime exceptions thrown during connection route setup
ca5e14e4e is described below

commit ca5e14e4e7581b278e39038ebeb827393993a2ec
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Thu Oct 17 12:06:30 2024 +0200

    Bug fix: Fixed propagation of runtime exceptions thrown during connection route setup
---
 .../hc/client5/http/impl/async/AsyncConnectExec.java       | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java
index c78a7db29..f07376ab1 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java
@@ -191,6 +191,20 @@ public final class AsyncConnectExec implements AsyncExecChainHandler {
             final AsyncExecChain.Scope scope,
             final AsyncExecChain chain,
             final AsyncExecCallback asyncExecCallback) {
+        try {
+            doProceedToNextHop(state, request, entityProducer, scope, chain, asyncExecCallback);
+        } catch (final RuntimeException ex) {
+            asyncExecCallback.failed(ex);
+        }
+    }
+
+    private void doProceedToNextHop(
+            final State state,
+            final HttpRequest request,
+            final AsyncEntityProducer entityProducer,
+            final AsyncExecChain.Scope scope,
+            final AsyncExecChain chain,
+            final AsyncExecCallback asyncExecCallback) {
         final RouteTracker tracker = state.tracker;
         final String exchangeId = scope.exchangeId;
         final HttpRoute route = scope.route;