public static SQLException forCancellation(Exception e) {
        Throwable cause = e.getCause();
        if (cause == null) {
            cause = e;
        }

        // operation canceled
        return new SQLException(e.getMessage(), SQL_STATE_OPERATION_CANCELLED, ClickHouseException.ERROR_ABORTED,
                cause);
    }
Helper class for building {@link SQLException}.
clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/SqlExceptionUtils.java