feat: Add error handling for pool connection in dbQueryClient function
Deploy Application / deploy (push) Successful in 29s Details

This commit is contained in:
faisolavolut 2025-10-29 15:09:14 +07:00
parent 47f1416193
commit be5461e7da
1 changed files with 13 additions and 1 deletions

View File

@ -38,7 +38,19 @@ export async function dbQueryClient({
message: "pool for database obtained", 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({ await db.activity_logs.create({
data: { data: {
action: "GET", action: "GET",