diff --git a/.changeset/calm-papayas-protect.md b/.changeset/calm-papayas-protect.md new file mode 100644 index 0000000000..c575754faa --- /dev/null +++ b/.changeset/calm-papayas-protect.md @@ -0,0 +1,5 @@ +--- +"blitz": minor +--- + +When db.\$reset() rejects, reject with an Error object diff --git a/packages/blitz/src/utils/enhance-prisma.ts b/packages/blitz/src/utils/enhance-prisma.ts index 24a4f02ebb..b7e22739e0 100644 --- a/packages/blitz/src/utils/enhance-prisma.ts +++ b/packages/blitz/src/utils/enhance-prisma.ts @@ -40,7 +40,7 @@ export const enhancePrisma = ( const process = spawn(prismaBin, ["migrate", "reset", "--force", "--skip-generate"], { stdio: "ignore", }) - process.on("exit", (code) => (code === 0 ? res(0) : rej(code))) + process.on("exit", (code) => (code === 0 ? res(0) : rej(new Error(`db.$reset() failed with code ${code}`)))) }) globalThis._blitz_prismaClient.$disconnect() }