Still throw errors in pokemon fetch if it's not a 404

This commit is contained in:
Dragon Fire
2020-03-24 15:09:34 -04:00
parent 045176f799
commit aec89a28c7
3 changed files with 4 additions and 4 deletions
-1
View File
@@ -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
View File
@@ -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": {
+3 -2
View File
@@ -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;
} }
} }
}; };