@@ -187,11 +187,11 @@ function ptrToString(ptr: number): string {
187187export const parse = awaitInit ( async ( query : string ) : Promise < ParseResult > => {
188188 // Input validation
189189 if ( query === null || query === undefined ) {
190- throw new SqlError ( 'Query cannot be null or undefined' ) ;
190+ throw new Error ( 'Query cannot be null or undefined' ) ;
191191 }
192192
193193 if ( query === '' ) {
194- throw new SqlError ( 'Query cannot be empty' ) ;
194+ throw new Error ( 'Query cannot be empty' ) ;
195195 }
196196
197197 const queryPtr = stringToPtr ( query ) ;
@@ -200,7 +200,7 @@ export const parse = awaitInit(async (query: string): Promise<ParseResult> => {
200200 try {
201201 resultPtr = wasmModule . _wasm_parse_query_raw ( queryPtr ) ;
202202 if ( ! resultPtr ) {
203- throw new SqlError ( 'Failed to parse query: memory allocation failed' ) ;
203+ throw new Error ( 'Failed to parse query: memory allocation failed' ) ;
204204 }
205205
206206 // Read the PgQueryParseResult struct
@@ -230,7 +230,7 @@ export const parse = awaitInit(async (query: string): Promise<ParseResult> => {
230230 }
231231
232232 if ( ! parseTreePtr ) {
233- throw new SqlError ( 'No parse tree generated' ) ;
233+ throw new Error ( 'No parse tree generated' ) ;
234234 }
235235
236236 const parseTreeStr = wasmModule . UTF8ToString ( parseTreePtr ) ;
@@ -343,11 +343,11 @@ export function parseSync(query: string): ParseResult {
343343
344344 // Input validation
345345 if ( query === null || query === undefined ) {
346- throw new SqlError ( 'Query cannot be null or undefined' ) ;
346+ throw new Error ( 'Query cannot be null or undefined' ) ;
347347 }
348348
349349 if ( query === '' ) {
350- throw new SqlError ( 'Query cannot be empty' ) ;
350+ throw new Error ( 'Query cannot be empty' ) ;
351351 }
352352
353353 const queryPtr = stringToPtr ( query ) ;
@@ -356,7 +356,7 @@ export function parseSync(query: string): ParseResult {
356356 try {
357357 resultPtr = wasmModule . _wasm_parse_query_raw ( queryPtr ) ;
358358 if ( ! resultPtr ) {
359- throw new SqlError ( 'Failed to parse query: memory allocation failed' ) ;
359+ throw new Error ( 'Failed to parse query: memory allocation failed' ) ;
360360 }
361361
362362 // Read the PgQueryParseResult struct
@@ -386,7 +386,7 @@ export function parseSync(query: string): ParseResult {
386386 }
387387
388388 if ( ! parseTreePtr ) {
389- throw new SqlError ( 'No parse tree generated' ) ;
389+ throw new Error ( 'No parse tree generated' ) ;
390390 }
391391
392392 const parseTreeStr = wasmModule . UTF8ToString ( parseTreePtr ) ;
0 commit comments