handle unhandledRejection

This commit is contained in:
loicbersier 2019-12-27 23:05:48 +01:00
parent 183630d23a
commit e3586c7395

View file

@ -0,0 +1,16 @@
const { Listener } = require('discord-akairo');
class unhandledRejectionListener extends Listener {
constructor() {
super('unhandledRejection', {
emitter: 'process',
event: 'unhandledRejection'
});
}
async exec(error) {
return console.error(`\x1b[31mUncaught Promise Rejection: ${error}\x1b[37m`);
}
}
module.exports = unhandledRejectionListener;