308 Function<ExchangeImpl<T>,CompletableFuture<Response>> andThen) { |
308 Function<ExchangeImpl<T>,CompletableFuture<Response>> andThen) { |
309 t = Utils.getCompletionCause(t); |
309 t = Utils.getCompletionCause(t); |
310 if (t instanceof ProxyAuthenticationRequired) { |
310 if (t instanceof ProxyAuthenticationRequired) { |
311 bodyIgnored = MinimalFuture.completedFuture(null); |
311 bodyIgnored = MinimalFuture.completedFuture(null); |
312 Response proxyResponse = ((ProxyAuthenticationRequired)t).proxyResponse; |
312 Response proxyResponse = ((ProxyAuthenticationRequired)t).proxyResponse; |
|
313 HttpConnection c = ex == null ? null : ex.connection(); |
313 Response syntheticResponse = new Response(request, this, |
314 Response syntheticResponse = new Response(request, this, |
314 proxyResponse.headers, proxyResponse.statusCode, |
315 proxyResponse.headers, c, proxyResponse.statusCode, |
315 proxyResponse.version, true); |
316 proxyResponse.version, true); |
316 return MinimalFuture.completedFuture(syntheticResponse); |
317 return MinimalFuture.completedFuture(syntheticResponse); |
317 } else if (t != null) { |
318 } else if (t != null) { |
318 return MinimalFuture.failedFuture(t); |
319 return MinimalFuture.failedFuture(t); |
319 } else { |
320 } else { |