Skip to content

Commit 7d4d4d9

Browse files
committed
made readError use backwardcompatible API
1 parent 93400f3 commit 7d4d4d9

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
@@ -74,8 +74,9 @@ public CloseableHttpClient createHttpClient(Map<String, String> chConfig, Map<St
7474
public Exception readError(ClassicHttpResponse httpResponse) {
7575
try (ByteArrayOutputStream out = new ByteArrayOutputStream(ERROR_BODY_BUFFER_SIZE)) {
7676
httpResponse.getEntity().writeTo(out);
77+
String message = out.toString();
7778
int serverCode = getHeaderInt(httpResponse.getFirstHeader(ClickHouseHttpProto.HEADER_EXCEPTION_CODE), 0);
78-
return new ServerException(serverCode, out.toString(StandardCharsets.UTF_8));
79+
return new ServerException(serverCode, message);
7980
} catch (IOException e) {
8081
throw new ClientException("Failed to read response body", e);
8182
}

0 commit comments

Comments
 (0)