From 561290285d950c34081e2ee2af59e9a77f72202c Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 1 Apr 2024 16:39:39 -0400 Subject: [PATCH] fix: correctly log eager seed errors --- packages/db/src/core/integration/index.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/db/src/core/integration/index.ts b/packages/db/src/core/integration/index.ts index 5c001bd46702..986b2f84c6ed 100644 --- a/packages/db/src/core/integration/index.ts +++ b/packages/db/src/core/integration/index.ts @@ -145,10 +145,17 @@ function astroDBIntegration(): AstroIntegration { seedInFlight = true; const mod = server.moduleGraph.getModuleById(resolved.seedVirtual); if (mod) server.moduleGraph.invalidateModule(mod); - server.ssrLoadModule(resolved.seedVirtual).then(() => { - seedInFlight = false; - logger.info('Seeded database.'); - }); + server + .ssrLoadModule(resolved.seedVirtual) + .then(() => { + logger.info('Seeded database.'); + }) + .catch((e) => { + logger.error(e instanceof Error ? e.message : String(e)); + }) + .finally(() => { + seedInFlight = false; + }); } }, 100); },