joeldesante / Harvey

Community managment Discord bot for the Old Dominion University Computer Science community.
GNU General Public License v3.0
6 stars 4 forks source link

Send errors via Discord instead of throwing errors #49

Closed willuhmjs closed 1 year ago

willuhmjs commented 1 year ago

There is at least one instance where an error should be delivered to the user instead of being thrown. For instance, instead of throwing a console error and crashing the bot, this should send an embed that tells the user to setup the course role settings.

const courseRoleSettings = await CourseRolesSetting.findOne({ where: { guildId: guild.id } });
if (courseRoleSettings === null) {
    throw new Error("Course role settings are not configured.");
}