mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 00:08:06 +02:00
Still throw errors in pokemon fetch if it's not a 404
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user