File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @pgsql/parser" ,
3
- "version" : " 1.0.4 " ,
3
+ "version" : " 1.0.5 " ,
4
4
"author" :
" Dan Lynch <[email protected] >" ,
5
5
"description" : " Multi-version PostgreSQL parser with dynamic version selection" ,
6
6
"main" : " ./wasm/index.cjs" ,
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ class Parser {
26
26
try {
27
27
return this.parser.parse(query);
28
28
} catch (error) {
29
+ // Preserve the original error if it's a SqlError
30
+ if (error.name === 'SqlError') {
31
+ throw error;
32
+ }
29
33
throw new Error(`Parse error in PostgreSQL ${this.version}: ${error.message}`);
30
34
}
31
35
}
@@ -37,6 +41,10 @@ class Parser {
37
41
try {
38
42
return this.parser.parseSync(query);
39
43
} catch (error) {
44
+ // Preserve the original error if it's a SqlError
45
+ if (error.name === 'SqlError') {
46
+ throw error;
47
+ }
40
48
throw new Error(`Parse error in PostgreSQL ${this.version}: ${error.message}`);
41
49
}
42
50
}
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ export class Parser {
26
26
try {
27
27
return this.parser.parse(query);
28
28
} catch (error) {
29
+ // Preserve the original error if it's a SqlError
30
+ if (error.name === 'SqlError') {
31
+ throw error;
32
+ }
29
33
throw new Error(`Parse error in PostgreSQL ${this.version}: ${error.message}`);
30
34
}
31
35
}
@@ -37,6 +41,10 @@ export class Parser {
37
41
try {
38
42
return this.parser.parseSync(query);
39
43
} catch (error) {
44
+ // Preserve the original error if it's a SqlError
45
+ if (error.name === 'SqlError') {
46
+ throw error;
47
+ }
40
48
throw new Error(`Parse error in PostgreSQL ${this.version}: ${error.message}`);
41
49
}
42
50
}
You can’t perform that action at this time.
0 commit comments