Source:
<code>public ProxyConnection request(ProxyRequest proxyRequest, Handler<ProxyResponse> responseHandler) { HttpClient httpClient = httpClients.computeIfAbsent(Vertx.currentContext(), createHttpClient()); final URI uri = proxyRequest.uri(); final int port = uri.getPort() != -1 ? uri.getPort() : (HTTPS_SCHEME.equals(uri.getScheme()) ? 443 : 80); String relativeUri = (uri.getRawQuery() == null) ? uri.getRawPath() : uri.getRawPath() + '?' + uri.getRawQuery(); HttpClientRequest clientRequest = httpClient.request( convert(proxyRequest.method()), port, uri.getHost(), relativeUri); clientRequest.setTimeout(endpoint.getHttpClientOptions().getReadTimeout()); VertxProxyConnection proxyConnection = new VertxProxyConnection(clientRequest); clientRequest.handler(clientResponse -> handleClientResponse(proxyConnection, clientResponse, responseHandler)); clientRequest.exceptionHandler(event -> { proxyRequest.request().metrics().setMessage(event.getMessage()); <START> <END> if (proxyConnection.connectTimeoutHandler() != null && event instanceof ConnectTimeoutException) { proxyConnection.connectTimeoutHandler().handle(event); } else { VertxProxyResponse clientResponse = new VertxProxyResponse( ((event instanceof ConnectTimeoutException) || (event instanceof TimeoutException)) ? HttpStatusCode.GATEWAY_TIMEOUT_504 : HttpStatusCode.BAD_GATEWAY_502); clientResponse.headers().set(HttpHeaders.CONNECTION, HttpHeadersValues.CONNECTION_CLOSE); responseHandler.handle(clientResponse); clientResponse.endHandler().handle(null); } }); copyRequestHeaders(proxyRequest.headers(), clientRequest); if (hasContent(proxyRequest.headers())) { String transferEncoding = proxyRequest.headers().getFirst(HttpHeaders.TRANSFER_ENCODING); if (HttpHeadersValues.TRANSFER_ENCODING_CHUNKED.equalsIgnoreCase(transferEncoding)) { clientRequest.setChunked(true); } } return proxyConnection; }</code><technical_language>I error log in addition setMessage</technical_language>

Target:
public ProxyConnection request(ProxyRequest proxyRequest, Handler<ProxyResponse> responseHandler) { HttpClient httpClient = httpClients.computeIfAbsent(Vertx.currentContext(), createHttpClient()); final URI uri = proxyRequest.uri(); final int port = uri.getPort() != -1 ? uri.getPort() : (HTTPS_SCHEME.equals(uri.getScheme()) ? 443 : 80); String relativeUri = (uri.getRawQuery() == null) ? uri.getRawPath() : uri.getRawPath() + '?' + uri.getRawQuery(); HttpClientRequest clientRequest = httpClient.request( convert(proxyRequest.method()), port, uri.getHost(), relativeUri); clientRequest.setTimeout(endpoint.getHttpClientOptions().getReadTimeout()); VertxProxyConnection proxyConnection = new VertxProxyConnection(clientRequest); clientRequest.handler(clientResponse -> handleClientResponse(proxyConnection, clientResponse, responseHandler)); clientRequest.exceptionHandler(event -> { LOGGER.error("Server proxying failed: {}", event.getMessage()); proxyRequest.request().metrics().setMessage(event.getMessage()); if (proxyConnection.connectTimeoutHandler() != null && event instanceof ConnectTimeoutException) { proxyConnection.connectTimeoutHandler().handle(event); } else { VertxProxyResponse clientResponse = new VertxProxyResponse( ((event instanceof ConnectTimeoutException) || (event instanceof TimeoutException)) ? HttpStatusCode.GATEWAY_TIMEOUT_504 : HttpStatusCode.BAD_GATEWAY_502); clientResponse.headers().set(HttpHeaders.CONNECTION, HttpHeadersValues.CONNECTION_CLOSE); responseHandler.handle(clientResponse); clientResponse.endHandler().handle(null); } }); copyRequestHeaders(proxyRequest.headers(), clientRequest); if (hasContent(proxyRequest.headers())) { String transferEncoding = proxyRequest.headers().getFirst(HttpHeaders.TRANSFER_ENCODING); if (HttpHeadersValues.TRANSFER_ENCODING_CHUNKED.equalsIgnoreCase(transferEncoding)) { clientRequest.setChunked(true); } } return proxyConnection; }