From 072813adc3927abc231667d8af92354761406e1e Mon Sep 17 00:00:00 2001 From: Jan <26145882+imverum@users.noreply.github.com> Date: Sun, 6 Dec 2020 20:40:46 +0100 Subject: [PATCH] Send error message when fetching timetable fails --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index 245e453..beb4009 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,6 +40,15 @@ let fetchUpdates = () => { }); } catch(e) { console.error(e); + try { + let embed = new Discord.MessageEmbed() + .setTitle('An error has occurred.') + .setDescription(`\`\`\`js\n${e}\`\`\``) + .setColor(0xff0000); + sendEmbed(embed); + } catch(e) { + console.error(e); + } } }