Closed jpreardon closed 3 years ago
With the introduction of fetch(), there are a lot of these if statements that can be moved to a handleErrors function:
if (res.ok) { return res.json() } else { throw new Error(res.status); }
Here's an example of that: https://www.tjvantoll.com/2015/09/13/fetch-and-errors/
This is part of #19
With the introduction of fetch(), there are a lot of these if statements that can be moved to a handleErrors function:
Here's an example of that: https://www.tjvantoll.com/2015/09/13/fetch-and-errors/
This is part of #19