Browse Source

Add some error handling

master
benji7425 4 years ago
parent
commit
44d69cd12d
  1. 2
      app/models/feed-data.js
  2. 2
      app/models/guild-data.js

2
app/models/feed-data.js

@ -64,7 +64,7 @@ module.exports = class FeedData {
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;
channel.send((role ? role + " " : "") + latest);
channel.send((role ? role + " " : "") + latest).catch(err => DiscordUtil.dateError(`Error posting in ${channel.id}`));
}
}
});

2
app/models/guild-data.js

@ -11,7 +11,7 @@ module.exports = class GuildData {
const promises = [];
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);

Loading…
Cancel
Save