Catch that

This commit is contained in:
Daniel Odendahl Jr
2017-10-14 00:39:30 +00:00
parent 152c56d0b1
commit cbd827c76a
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -7,7 +7,11 @@ manager.spawn(undefined, 1000);
setInterval(async () => {
if (!manager.shards.has(0)) return;
const guilds = await manager.fetchClientValues('guilds.size');
const count = guilds.reduce((prev, val) => prev + val, 0);
postStats(count, await manager.shards.get(0).fetchClientValue('user.id'));
try {
const guilds = await manager.fetchClientValues('guilds.size');
const count = guilds.reduce((prev, val) => prev + val, 0);
await postStats(count, await manager.shards.get(0).fetchClientValue('user.id'));
} catch (err) {
console.error(`[STATS] Failed to post stats. ${err}`);
}
}, 300000);
+1 -1
View File
@@ -106,6 +106,6 @@ client.setInterval(() => {
client.login(TOKEN);
process.on('unhandledRejection', err => {
console.error('[FATAL] Unhandled Promise Rejection:', err);
console.error('[FATAL] Unhandled Promise Rejection.', err);
process.exit(1);
});