feat: Add error handling for pool connection in dbQueryClient function
Deploy Application / deploy (push) Successful in 29s
Details
Deploy Application / deploy (push) Successful in 29s
Details
This commit is contained in:
parent
47f1416193
commit
be5461e7da
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue