Skip to content

Commit 409ccf0

Browse files
Fix types
1 parent 1cbf2eb commit 409ccf0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ class PlanetScaleConnection implements DatabaseConnection {
119119

120120
const results = await this.#conn.execute(compiledQuery.sql, parameters)
121121

122-
// If an error is returned throw it.
123-
if (results.error) {
124-
throw results.error
122+
// @planetscale/database versions older than 1.3.0 return errors directly, rather than throwing
123+
if ((results as any).error) {
124+
throw (results as any).error
125125
}
126126

127127
return {

0 commit comments

Comments
 (0)