Skip to content

Commit 0535bf2

Browse files
committed
Change type signature of SqlError so it doesn't print Symbol(SqlRef).
1 parent d1ef85e commit 0535bf2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/db.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@ import { type Sql, type SqlDbRefs, type StaticIn, dbRefs } from "./types";
99

1010
// Custom error for SQL operations
1111
export class SqlError extends Error {
12-
command: Sql;
12+
readonly query: Sql["query"];
13+
readonly values: Sql["values"];
1314
constructor(error: any, command: Sql) {
1415
super(error + "", { cause: error });
1516
this.name = "SqlError";
16-
this.command = command;
17+
const { query, values } = command;
18+
this.query = query;
19+
this.values = values;
1720
}
1821
toString() {
19-
const { query, values } = this.command;
2022
return (
2123
`${this.name}: ${this.message}\n` +
22-
`in ( ${query} )\n` +
23-
`of ${JSON.stringify(values)}\n` +
24+
`in ( ${this.query} )\n` +
25+
`of ${JSON.stringify(this.values)}\n` +
2426
this.stack
2527
);
2628
}

0 commit comments

Comments
 (0)