Skip to content

Commit bb37106

Browse files
committed
pr feedback
Signed-off-by: Ilya Boyandin <ilyabo@gmail.com>
1 parent ec056a4 commit bb37106

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/duckdb/src/table/duckdb-table-utils.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export async function getDuckDBColumnTypes(
4848
type: columnTypes?.get(i)
4949
});
5050
}
51-
} catch (error) {
51+
} catch (primaryError) {
5252
try {
5353
const resDescribe = await connection.query(`DESCRIBE ${quotedTableName}`);
5454
const numRows = resDescribe.numRows;
@@ -62,11 +62,14 @@ export async function getDuckDBColumnTypes(
6262
});
6363
}
6464
} catch (fallbackError) {
65-
console.warn(
66-
'[DuckDB] Failed to load column types for',
67-
tableName,
68-
fallbackError
65+
const error = new Error(
66+
`[DuckDB] Failed to load column types for ${tableName} (PRAGMA + DESCRIBE).`
6967
);
68+
(error as Error & {cause?: unknown}).cause = {
69+
primaryError,
70+
fallbackError
71+
};
72+
throw error;
7073
}
7174
}
7275

0 commit comments

Comments
 (0)