Skip to content

Commit e948856

Browse files
authored
fix(clickhouse-driver): Replace error cause with string formatting (#8977)
Error cause is not properly propagated in REST API, so use direct formatting for now
1 parent 7b1f797 commit e948856

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/cubejs-clickhouse-driver/src/ClickHouseDriver.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ export class ClickHouseDriver extends BaseDriver implements DriverInterface {
259259
const results = await resultSet.json<Record<string, unknown>>();
260260
return results;
261261
} catch (e) {
262-
throw new Error(`Query failed; query id: ${queryId}, SQL: ${query}`, { cause: e });
262+
// TODO replace string formatting with proper cause
263+
throw new Error(`Query failed; cause: ${e}; query id: ${queryId}; SQL: ${query}`);
263264
}
264265
});
265266
}
@@ -407,7 +408,8 @@ export class ClickHouseDriver extends BaseDriver implements DriverInterface {
407408
};
408409
} catch (e) {
409410
await client.close();
410-
throw new Error(`Stream query failed; query id: ${queryId}, SQL: ${query}`, { cause: e });
411+
// TODO replace string formatting with proper cause
412+
throw new Error(`Stream query failed; cause: ${e}; query id: ${queryId}; SQL: ${query}`);
411413
}
412414
}
413415

@@ -551,7 +553,8 @@ export class ClickHouseDriver extends BaseDriver implements DriverInterface {
551553
try {
552554
await this.command(createTableSql);
553555
} catch (e) {
554-
throw new Error(`Error during create table: ${createTableSql}`, { cause: e });
556+
// TODO replace string formatting with proper cause
557+
throw new Error(`Create table failed; cause: ${e}; SQL: ${createTableSql}`);
555558
}
556559
}
557560

0 commit comments

Comments
 (0)