From 4c140a18c309bf5453c15dbd1d678ccafbc738e6 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 24 Aug 2017 21:18:02 +0000 Subject: [PATCH] Better Today Error Checks --- commands/random-res/today.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/random-res/today.js b/commands/random-res/today.js index 64d4eb34..64c3b0a7 100644 --- a/commands/random-res/today.js +++ b/commands/random-res/today.js @@ -38,7 +38,8 @@ module.exports = class TodayCommand extends Command { .setDescription(`${event.year}: ${event.text}`); return msg.embed(embed); } catch (err) { - return msg.say(`An error occurred: \`${err.message}\`. You likely entered an invalid date.`); + if (err.status === 404 || err.status === 500) return msg.say('Invalid Date.'); + throw err; } } };