Updates
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import fs from "fs";
|
||||
import serverError from "./serverError";
|
||||
import mysql from "serverless-mysql";
|
||||
import grabDSQLConnection from "../../utils/grab-dsql-connection";
|
||||
import path from "path";
|
||||
|
||||
/**
|
||||
* # Main DB Handler Function
|
||||
@@ -37,8 +37,12 @@ export default async function dbHandler(...args: any[]) {
|
||||
);
|
||||
});
|
||||
} catch (error: any) {
|
||||
const tmpFolder = path.resolve(process.cwd(), "./.tmp");
|
||||
if (!fs.existsSync(tmpFolder))
|
||||
fs.mkdirSync(tmpFolder, { recursive: true });
|
||||
|
||||
fs.appendFileSync(
|
||||
"./.tmp/dbErrorLogs.txt",
|
||||
path.resolve(tmpFolder, "./dbErrorLogs.txt"),
|
||||
JSON.stringify(error, null, 4) + "\n" + Date() + "\n\n\n",
|
||||
"utf8"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user