Skip to content

Commit

Permalink
Create anticrash.js
Browse files Browse the repository at this point in the history
  • Loading branch information
adh319 committed Sep 22, 2024
1 parent ff325b4 commit 4eb9563
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/handlers/anticrash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = async () => {
process.on("unhandledRejection", async (reason, promise) => {
console.error("[Anticrash] | [UnhandledRejection_Logs] | [start] : ===============");
console.error("Unhandled Rejection at:", promise, "reason:", reason);
console.error("[Anticrash] | [UnhandledRejection_Logs] | [end] : ===============");
});

process.on("uncaughtException", async (err, origin) => {
console.error("[Anticrash] | [UncaughtException_Logs] | [Start] : ===============");
console.error(`Uncaught exception: ${err}\n` + `Exception origin: ${origin}`);
console.error("[Anticrash] | [UncaughtException_Logs] | [End] : ===============");
});

process.on("uncaughtExceptionMonitor", async (err, origin) => {
console.error("[Anticrash] | [UncaughtExceptionMonitor_Logs] | [Start] : ===============");
console.error(`Uncaught exception monitor: ${err}\n` + `Exception origin: ${origin}`);
console.error("[Anticrash] | [UncaughtExceptionMonitor_Logs] | [End] : ===============");
});

console.log("[INFO] Anticrash events loaded");
};

/**
* Project: Lunox
* Author: adh319
* Company: EnourDev
* This code is the property of EnourDev and may not be reproduced or
* modified without permission. For more information, contact us at
* https://discord.gg/xhTVzbS5NU
*/

0 comments on commit 4eb9563

Please sign in to comment.