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 11{
22 "name" : " @pgsql/parser" ,
3- "version" : " 1.0.4 " ,
3+ "version" : " 1.0.5 " ,
44 "author" :
" Dan Lynch <[email protected] >" ,
55 "description" : " Multi-version PostgreSQL parser with dynamic version selection" ,
66 "main" : " ./wasm/index.cjs" ,
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ class Parser {
2626 try {
2727 return this.parser.parse(query);
2828 } catch (error) {
29+ // Preserve the original error if it's a SqlError
30+ if (error.name === 'SqlError') {
31+ throw error;
32+ }
2933 throw new Error(`Parse error in PostgreSQL ${this.version}: ${error.message}`);
3034 }
3135 }
@@ -37,6 +41,10 @@ class Parser {
3741 try {
3842 return this.parser.parseSync(query);
3943 } catch (error) {
44+ // Preserve the original error if it's a SqlError
45+ if (error.name === 'SqlError') {
46+ throw error;
47+ }
4048 throw new Error(`Parse error in PostgreSQL ${this.version}: ${error.message}`);
4149 }
4250 }
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ export class Parser {
2626 try {
2727 return this.parser.parse(query);
2828 } catch (error) {
29+ // Preserve the original error if it's a SqlError
30+ if (error.name === 'SqlError') {
31+ throw error;
32+ }
2933 throw new Error(`Parse error in PostgreSQL ${this.version}: ${error.message}`);
3034 }
3135 }
@@ -37,6 +41,10 @@ export class Parser {
3741 try {
3842 return this.parser.parseSync(query);
3943 } catch (error) {
44+ // Preserve the original error if it's a SqlError
45+ if (error.name === 'SqlError') {
46+ throw error;
47+ }
4048 throw new Error(`Parse error in PostgreSQL ${this.version}: ${error.message}`);
4149 }
4250 }
You can’t perform that action at this time.
0 commit comments