forked from Galactic/galactic-bot
move process error listener to logger
This commit is contained in:
parent
82d3b9392b
commit
6d2d1fec72
4
index.js
4
index.js
@ -3,7 +3,3 @@ const options = require('./options.json');
|
|||||||
|
|
||||||
new Manager(options)
|
new Manager(options)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
process.on("unhandledRejection", (error) => {
|
|
||||||
console.error("Unhandled promise rejection:", error); //eslint-disable-line no-console
|
|
||||||
});
|
|
@ -39,7 +39,11 @@ class Logger {
|
|||||||
//TODO: Add proper date-oriented filenames and add a daily rotation file (?).
|
//TODO: Add proper date-oriented filenames and add a daily rotation file (?).
|
||||||
|
|
||||||
this.shardManager
|
this.shardManager
|
||||||
.on('shardCreate', (shard) => this.write('debug', "Shard created.", shard));
|
.on('shardCreate', (shard) => this.write('info', "Shard created.", shard));
|
||||||
|
|
||||||
|
process.on("unhandledRejection", (error) => {
|
||||||
|
this.write('error', `Unhandled promise rejection:\n${error.stack}`); //eslint-disable-line no-console
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user