Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie committed Sep 25, 2022
1 parent 1cbf2eb commit 409ccf0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ class PlanetScaleConnection implements DatabaseConnection {

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

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

return {
Expand Down

0 comments on commit 409ccf0

Please sign in to comment.