From 2c8be96c1bc82f24eac087bfa9a52ac476465dd1 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 7 Dec 2023 12:23:26 +0100 Subject: [PATCH] Attempt to fix weather command crashing when website is down --- util/getWeather.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/getWeather.js b/util/getWeather.js index 96a9c46..878f26c 100644 --- a/util/getWeather.js +++ b/util/getWeather.js @@ -32,7 +32,9 @@ module.exports = async function (location) { }).on("error", (err) => { reject(err); }).on('timeout', (err) => { - reject(err) + resolve(`Timed out while getting weather for ${location}. Weather service might be down\nCheck console for more info`); + console.log(err); + success = false; }); })