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
+3 -2
View File
@@ -21,8 +21,9 @@ module.exports = class PokemonStore extends Collection {
const pokemon = new Pokemon(body);
this.set(pokemon.id, pokemon);
return pokemon;
} catch {
return null;
} catch (err) {
if (err.status === 404) return null;
throw err;
}
}
};