That's not true, the promise returned by fetch() only rejects if there is a proper network error or the connection itself doesn't get established. No matter what the status code is, it'll still resolve. There's nothing wrong with returning JSON in the body of a 500 for instance.
If there was a 404 with no JSON, your example would just throw an exception because json would be undefined so undefined.filter would be non-existant.
0
u/[deleted] Jul 10 '16
[deleted]