Updates
This commit is contained in:
@@ -42,6 +42,7 @@ export default async function connDbHandler<ReturnType = any>(
|
||||
label: "res",
|
||||
});
|
||||
}
|
||||
|
||||
return JSON.parse(JSON.stringify(res));
|
||||
} else if (typeof query == "object") {
|
||||
const resArray = [];
|
||||
@@ -86,6 +87,15 @@ export default async function connDbHandler<ReturnType = any>(
|
||||
}
|
||||
} catch (error: any) {
|
||||
global.ERROR_CALLBACK?.(`Connection DB Handler Error`, error as Error);
|
||||
|
||||
if (debug) {
|
||||
debugLog({
|
||||
log: `Connection DB Handler Error: ${error.message}`,
|
||||
addTime: true,
|
||||
label: "Error",
|
||||
});
|
||||
}
|
||||
|
||||
return null;
|
||||
} finally {
|
||||
conn?.end();
|
||||
|
||||
Reference in New Issue
Block a user