Update error handling in index.js

This commit is contained in:
Christopher Cookman 2024-05-13 12:33:33 -06:00
parent bcdda75a77
commit b4f4f4b017
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -1171,7 +1171,7 @@ process.on("unhandledRejection", (error, promise) => {
fs.mkdirSync("./error");
}
// write ./error/rejection_timestamp.txt
fs.writeFileSync(`./error/rejection_${Date.now()}.txt`, `ERROR:\n${error}\n\nPROMISE:\n${promise}`);
fs.writeFileSync(`./error/rejection_${Date.now()}.txt`, `ERROR:\n${error}\n\nPROMISE:\n${JSON.stringify(promise)}`);
return;
});