Skip to content

Commit f7db286

Browse files
committed
Fixed javadoc and improved test
1 parent c33f054 commit f7db286

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.clickhouse.client.api;
22

33
/**
4-
* Any exception that happens inside transport logic and hard to categorize as client logic
5-
* like connection initiation or data transfer. These exceptions are not retriable normally.
6-
* Main purpose of this exception is to wrap transport specific.
4+
* Transport-layer exception that is hard to categorize as connection initiation or data transfer.
5+
* These exceptions are not retryable by default.
6+
* Main purpose of this exception is to wrap transport-specific failures (e.g., SSL errors).
77
*/
88
public class TransportException extends ClickHouseException {
99
public TransportException(String message, Throwable cause, String queryId) {

client-v2/src/test/java/com/clickhouse/client/ErrorHandlingTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,13 @@ void testTransportException() throws Exception {
9191
.compressClientRequest(true)
9292
.build()) {
9393

94+
final String queryId = "test-failure-query-id";
9495
TransportException tex = Assert.expectThrows(TransportException.class,
95-
() -> client.query("SELECT 1").get());
96-
Assert.assertTrue(tex.getMessage().contains("SSL Problem"));
96+
() -> client.query("SELECT 1", new QuerySettings().setQueryId(queryId)).get());
97+
Assert.assertTrue(tex.getMessage().startsWith("SSL Problem"), "Unexpected message: " + tex.getMessage());
98+
Assert.assertEquals(tex.getQueryId(), queryId);
99+
Assert.assertTrue(tex.getCause() instanceof javax.net.ssl.SSLException,
100+
"Expected SSLException cause but was: " + tex.getCause());
97101
}
98102
}
99103

0 commit comments

Comments
 (0)