mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +02:00
chore: update warning/error logs
This commit is contained in:
parent
5895b3dd6e
commit
6593250945
@ -61,13 +61,14 @@ if (!fs.existsSync('./user/config.yml')) {
|
|||||||
const config = YAML.parse(fs.readFileSync('./user/config.yml', 'utf8'));
|
const config = YAML.parse(fs.readFileSync('./user/config.yml', 'utf8'));
|
||||||
const log = logger(config);
|
const log = logger(config);
|
||||||
|
|
||||||
process.on('unhandledRejection', error => {
|
process.on('uncaughtException', (error, origin) => {
|
||||||
log.notice(`Discord Tickets v${pkg.version} on Node.js ${process.version} (${process.platform})`);
|
log.notice(`Discord Tickets v${pkg.version} on Node.js ${process.version} (${process.platform})`);
|
||||||
log.notice('An error was not caught');
|
log.warn(origin === 'uncaughtException' ? 'Uncaught exception' : 'Unhandled promise rejection' + ` (${error.name})`);
|
||||||
if (error instanceof Error) log.warn(`Uncaught ${error.name}`);
|
|
||||||
log.error(error);
|
log.error(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.on('warning', warning => log.warn(warning.stack));
|
||||||
|
|
||||||
const client = new Client(config, log);
|
const client = new Client(config, log);
|
||||||
client.login().then(() => {
|
client.login().then(() => {
|
||||||
http(client);
|
http(client);
|
||||||
|
Loading…
Reference in New Issue
Block a user