Skip to content

Commit e904589

Browse files
committed
add ConnectException to multi-catch
1 parent a85ad86 commit e904589

File tree

1 file changed

+4
-3
lines changed
  • client-v2/src/main/java/com/clickhouse/client/api

1 file changed

+4
-3
lines changed

client-v2/src/main/java/com/clickhouse/client/api/Client.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import java.io.InputStream;
6464
import java.lang.reflect.InvocationTargetException;
6565
import java.lang.reflect.Method;
66+
import java.net.ConnectException;
6667
import java.net.URL;
6768
import java.nio.charset.StandardCharsets;
6869
import java.time.Duration;
@@ -1408,7 +1409,7 @@ public CompletableFuture<InsertResponse> insert(String tableName, List<?> data,
14081409
metrics.operationComplete();
14091410
metrics.setQueryId(queryId);
14101411
return new InsertResponse(metrics);
1411-
} catch ( NoHttpResponseException | ConnectionRequestTimeoutException | ConnectTimeoutException e) {
1412+
} catch (NoHttpResponseException | ConnectionRequestTimeoutException | ConnectTimeoutException | ConnectException e) {
14121413
lastException = httpClientHelper.wrapException("Insert request initiation failed", e);
14131414
if (httpClientHelper.shouldRetry(e, finalSettings.getAllSettings())) {
14141415
LOG.warn("Retrying", e);
@@ -1536,7 +1537,7 @@ public CompletableFuture<InsertResponse> insert(String tableName,
15361537
metrics.operationComplete();
15371538
metrics.setQueryId(queryId);
15381539
return new InsertResponse(metrics);
1539-
} catch ( NoHttpResponseException | ConnectionRequestTimeoutException | ConnectTimeoutException e) {
1540+
} catch (NoHttpResponseException | ConnectionRequestTimeoutException | ConnectTimeoutException | ConnectException e) {
15401541
lastException = httpClientHelper.wrapException("Insert request initiation failed", e);
15411542
if (httpClientHelper.shouldRetry(e, finalSettings.getAllSettings())) {
15421543
LOG.warn("Retrying", e);
@@ -1702,7 +1703,7 @@ public CompletableFuture<QueryResponse> query(String sqlQuery, Map<String, Objec
17021703

17031704
return new QueryResponse(httpResponse, finalSettings.getFormat(), finalSettings, metrics);
17041705

1705-
} catch ( NoHttpResponseException | ConnectionRequestTimeoutException | ConnectTimeoutException e) {
1706+
} catch (NoHttpResponseException | ConnectionRequestTimeoutException | ConnectTimeoutException | ConnectException e) {
17061707
lastException = httpClientHelper.wrapException("Query request initiation failed", e);
17071708
if (httpClientHelper.shouldRetry(e, finalSettings.getAllSettings())) {
17081709
LOG.warn("Retrying.", e);

0 commit comments

Comments
 (0)