Add some error handling

This commit is contained in:
benji7425 2017-09-20 01:18:23 +01:00
parent ed427fe3b2
commit 44d69cd12d
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ module.exports = class FeedData {
const channel = guild.channels.find(ch => ch.type === "text" && ch.name.toLowerCase() === this.channelName.toLowerCase()); const channel = guild.channels.find(ch => ch.type === "text" && ch.name.toLowerCase() === this.channelName.toLowerCase());
const role = this.roleName ? guild.roles.find(role => role.name.toLowerCase() === this.roleName.toLowerCase()) : null; const role = this.roleName ? guild.roles.find(role => role.name.toLowerCase() === this.roleName.toLowerCase()) : null;
channel.send((role ? role + " " : "") + latest); channel.send((role ? role + " " : "") + latest).catch(err => DiscordUtil.dateError(`Error posting in ${channel.id}`));
} }
} }
}); });

View File

@ -11,7 +11,7 @@ module.exports = class GuildData {
const promises = []; const promises = [];
this.feeds.forEach(feed => { this.feeds.forEach(feed => {
promises.push(feed.updatePastPostedLinks(guild).catch(DiscordUtil.dateError)); promises.push(feed.updatePastPostedLinks(guild).catch(err => DiscordUtil.dateError(`Error reading history in ${err.path}`)));
}); });
return Promise.all(promises); return Promise.all(promises);