Add some error handling
This commit is contained in:
parent
ed427fe3b2
commit
44d69cd12d
|
@ -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}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue