handle unhandledRejection
This commit is contained in:
parent
183630d23a
commit
e3586c7395
1 changed files with 16 additions and 0 deletions
16
event/listeners/unhandledRejection.js
Normal file
16
event/listeners/unhandledRejection.js
Normal 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;
|
Loading…
Reference in a new issue