mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 06:37:32 +02:00
Still throw errors in pokemon fetch if it's not a 404
This commit is contained in:
@@ -52,7 +52,6 @@ module.exports = class PokedexCommand extends Command {
|
|||||||
.setThumbnail(data.spriteImageURL);
|
.setThumbnail(data.spriteImageURL);
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.status === 404) return msg.say('Could not find any results.');
|
|
||||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "112.14.2",
|
"version": "112.14.3",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -21,8 +21,9 @@ module.exports = class PokemonStore extends Collection {
|
|||||||
const pokemon = new Pokemon(body);
|
const pokemon = new Pokemon(body);
|
||||||
this.set(pokemon.id, pokemon);
|
this.set(pokemon.id, pokemon);
|
||||||
return pokemon;
|
return pokemon;
|
||||||
} catch {
|
} catch (err) {
|
||||||
return null;
|
if (err.status === 404) return null;
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user