Skip to content

Commit e64116d

Browse files
authored
fix(duckdb-driver): Throw error on broken connection (#6981)
1 parent 4ae089a commit e64116d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

packages/cubejs-duckdb-driver/src/DuckDBDriver.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,28 @@ export class DuckDBDriver extends BaseDriver implements DriverInterface {
5454

5555
try {
5656
await this.handleQuery(conn, 'INSTALL httpfs', []);
57-
await this.handleQuery(conn, 'LOAD httpfs', []);
5857
} catch (e) {
5958
if (this.logger) {
6059
console.error('DuckDB - error on httpfs installation', {
6160
e
6261
});
6362
}
63+
64+
// DuckDB will lose connection_ref on connection on error, this will lead to broken conn object
65+
throw e;
66+
}
67+
68+
try {
69+
await this.handleQuery(conn, 'LOAD httpfs', []);
70+
} catch (e) {
71+
if (this.logger) {
72+
console.error('DuckDB - error on loading httpfs', {
73+
e
74+
});
75+
}
76+
77+
// DuckDB will lose connection_ref on connection on error, this will lead to broken conn object
78+
throw e;
6479
}
6580

6681
try {

0 commit comments

Comments
 (0)