I have the following code:
fetch(
  url,
  { ...data }
).then((response) => {
  if (!response.ok) throw new Error(response.statusText);
  return response.json();
}).then((response) => {
  resolve(response);
}).catch((error) => {
  console.log('error', error);
  reject(error);
});
When I perform a request and get a 404, the console.log('error') line runs, but I still get an error int he console:
GET https://swapi.co/api/people/0/ 404 ()
Uncaught (in promise) Error
    at http.js:10
I can't figure out why this is happening, if the catch() block is running, why does it say uncaught (in promise)?
 
     
    