diff --git a/src/lib/dbQueryClient.ts b/src/lib/dbQueryClient.ts index b83e728..1742d47 100644 --- a/src/lib/dbQueryClient.ts +++ b/src/lib/dbQueryClient.ts @@ -38,7 +38,19 @@ export async function dbQueryClient({ message: "pool for database obtained", }, }); - await pool.connect(); + try { + await pool.connect(); + } catch (ex) { + console.error("Error obtaining pool for query", ex); + await db.activity_logs.create({ + data: { + action: "GET", + status: "ERROR", + message: "Error obtaining pool for query: " + get(ex, "message", ""), + }, + }); + throw ex; + } await db.activity_logs.create({ data: { action: "GET",