Skip to content

Commit ca5e14e

Browse files
committed
Bug fix: Fixed propagation of runtime exceptions thrown during connection route setup
1 parent 876d0f0 commit ca5e14e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncConnectExec.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,20 @@ private void proceedToNextHop(
191191
final AsyncExecChain.Scope scope,
192192
final AsyncExecChain chain,
193193
final AsyncExecCallback asyncExecCallback) {
194+
try {
195+
doProceedToNextHop(state, request, entityProducer, scope, chain, asyncExecCallback);
196+
} catch (final RuntimeException ex) {
197+
asyncExecCallback.failed(ex);
198+
}
199+
}
200+
201+
private void doProceedToNextHop(
202+
final State state,
203+
final HttpRequest request,
204+
final AsyncEntityProducer entityProducer,
205+
final AsyncExecChain.Scope scope,
206+
final AsyncExecChain chain,
207+
final AsyncExecCallback asyncExecCallback) {
194208
final RouteTracker tracker = state.tracker;
195209
final String exchangeId = scope.exchangeId;
196210
final HttpRoute route = scope.route;

0 commit comments

Comments
 (0)