Skip to content

Commit 64747a1

Browse files
committed
check for either ConnectException or ConnectTimeoutException for retries, add NoHttpResponseException to wrapException
1 parent e904589 commit 64747a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client-v2/src/main/java/com/clickhouse/client/api/internal/HttpAPIClientHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ public boolean shouldRetry(Exception ex, Map<String, Object> requestSettings) {
583583
return retryCauses.contains(ClientFaultCause.NoHttpResponse);
584584
}
585585

586-
if (ex instanceof ConnectTimeoutException) {
586+
if (ex instanceof ConnectException || ex instanceof ConnectTimeoutException) {
587587
return retryCauses.contains(ClientFaultCause.ConnectTimeout);
588588
}
589589

@@ -598,6 +598,7 @@ public boolean shouldRetry(Exception ex, Map<String, Object> requestSettings) {
598598
// ClientException will be also wrapped
599599
public ClientException wrapException(String message, Exception cause) {
600600
if (cause instanceof ConnectionRequestTimeoutException ||
601+
cause instanceof NoHttpResponseException ||
601602
cause instanceof ConnectTimeoutException ||
602603
cause instanceof ConnectException) {
603604
return new ConnectionInitiationException(message, cause);

0 commit comments

Comments
 (0)