File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,8 @@ async function withExecutorAndPool<R>(
6363 console . log ( 'Running query' , sql , params ) ;
6464 return await client . query ( sql , params ) ;
6565 } catch ( e ) {
66- console . error ( 'original error from pg' , e ) ;
67- throw new Error (
68- // eslint-disable-next-line @typescript-eslint/no-explicit-any
69- `Error executing SQL: ${ sql } : ${ ( e as unknown as any ) . toString ( ) } ` ,
70- ) ;
66+ console . error ( 'Error executing SQL' , e ) ;
67+ throw e ;
7168 }
7269 } ;
7370
@@ -122,7 +119,8 @@ async function transactWithExecutor<R>(
122119 throw new Error ( 'Tried to execute transacation too many times. Giving up.' ) ;
123120}
124121
125- //stackoverflow.com/questions/60339223/node-js-transaction-coflicts-in-postgresql-optimistic-concurrency-control-and
122+ // Because we are using SERIALIZABLE isolation level, we need to be prepared to retry transactions.
123+ // stackoverflow.com/questions/60339223/node-js-transaction-coflicts-in-postgresql-optimistic-concurrency-control-and
126124function shouldRetryTransaction ( err : unknown ) {
127125 // eslint-disable-next-line @typescript-eslint/no-explicit-any
128126 const code = typeof err === 'object' ? String ( ( err as any ) . code ) : null ;
You can’t perform that action at this time.
0 commit comments