Fix weather command crashing when website is down
This commit is contained in:
parent
95702b6ea9
commit
c4f526d37f
1 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,9 @@ module.exports = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let location = args.join(" ")
|
let location = args.join(" ")
|
||||||
let weather = {};
|
let weather = {
|
||||||
|
success: false
|
||||||
|
};
|
||||||
weather = await getWeather(location).catch((err) => {
|
weather = await getWeather(location).catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
weather.weather = `An error occured while getting the weather for ${location}\nSee console for more info`;
|
weather.weather = `An error occured while getting the weather for ${location}\nSee console for more info`;
|
||||||
|
|
Loading…
Add table
Reference in a new issue