drizzle-team / drizzle-team/drizzle-orm
[durable-sqlite] Migrator masks true error during migration
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
https://github.com/drizzle-team/drizzle-orm/blob/06be106f3d111339466eb596d000d7580c89b01f/drizzle-orm/src/durable-sqlite/migrator.ts#L80-L83
Here the migrator catches any error happened in the transaction, calls `tx.rollback()` and throw error again. However, `tx.rollback()` itself just throws a generic `DrizzleError: Rollback` error and never properly returns, so the `throw` line later is basically dead code. Is this expected?
In my case this behavior basically masked actual migration error and make it very hard to debug. I ended up copying this file over and get rid of the whole `try { ... } catch () {}` wrapper to get the actual error.
Contributor guide
Assessment
This issue has not been assessed yet.