DrizzleError: Rollback is being rethrown unexpectedly

No matter which error I throw for the rollback - it doesn't work as indented because it bleeds outside the transaction as postgres-js is rethrowing it.

const mute = await db.transaction(async (tx) => {
  await tx.rollback();
});


Such simple code results in my top-level error handler being triggered with DrizzleError: Rollback

Relevant postgres-js line: https://github.com/porsager/postgres/blob/master/src/index.js#L271
GitHub
Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare - porsager/postgres
Was this page helpful?