This commit is contained in:
Benjamin Toby
2025-01-25 14:20:25 +01:00
parent 1db9c3a2e7
commit e82bcd0824
91 changed files with 936 additions and 324 deletions
+5 -1
View File
@@ -16,6 +16,7 @@ exports.default = dbHandler;
const fs_1 = __importDefault(require("fs"));
const serverError_1 = __importDefault(require("./serverError"));
const grab_dsql_connection_1 = __importDefault(require("../../utils/grab-dsql-connection"));
const path_1 = __importDefault(require("path"));
/**
* # Main DB Handler Function
*/
@@ -44,7 +45,10 @@ function dbHandler(...args) {
});
}
catch (error) {
fs_1.default.appendFileSync("./.tmp/dbErrorLogs.txt", JSON.stringify(error, null, 4) + "\n" + Date() + "\n\n\n", "utf8");
const tmpFolder = path_1.default.resolve(process.cwd(), "./.tmp");
if (!fs_1.default.existsSync(tmpFolder))
fs_1.default.mkdirSync(tmpFolder, { recursive: true });
fs_1.default.appendFileSync(path_1.default.resolve(tmpFolder, "./dbErrorLogs.txt"), JSON.stringify(error, null, 4) + "\n" + Date() + "\n\n\n", "utf8");
results = null;
(0, serverError_1.default)({
component: "dbHandler",