-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
29 lines (23 loc) · 906 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const {bot} = require('./structures/client')
new bot()
let errorsToIgnore = [10008]
process.on('unhandledRejection', (reason, p) => {
if(errorsToIgnore.includes(reason.code)) return;
console.log(' [antiCrash] :: Unhandled Rejection/Catch');
console.log(reason, p);
});
process.on('uncaughtException', (err, origin) => {
if(errorsToIgnore.includes(err.code)) return;
console.log(' [antiCrash] :: Uncaught Exception/Catch');
console.log(err, origin);
});
process.on('uncaughtExceptionMonitor', (err, origin) => {
if(errorsToIgnore.includes(err.code)) return;
console.log(' [antiCrash] :: Uncaught Exception/Catch (MONITOR)');
console.log(err, origin);
});
process.on('multipleResolves', (type, promise, reason) => {
if(errorsToIgnore.includes(reason.code)) return;
console.log(' [antiCrash] :: Multiple Resolves');
console.log(type, promise, reason);
});