2019-12-27 23:05:48 +01:00
|
|
|
const { Listener } = require('discord-akairo');
|
|
|
|
|
|
|
|
class unhandledRejectionListener extends Listener {
|
|
|
|
constructor() {
|
|
|
|
super('unhandledRejection', {
|
|
|
|
emitter: 'process',
|
|
|
|
event: 'unhandledRejection'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-06-17 15:29:09 +02:00
|
|
|
async exec(error, reason) {
|
|
|
|
console.error(reason);
|
2019-12-27 23:05:48 +01:00
|
|
|
return console.error(`\x1b[31mUncaught Promise Rejection: ${error}\x1b[37m`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = unhandledRejectionListener;
|