JS Quiz: Hard: Fetch error handling misconception

Which branch runs when the server returns 404?

fetch('/missing')
  .then((r) => {
    if (!r.ok) return 'bad';
    return 'good';
  })
  .catch(() => 'caught')
  .then((v) => console.log(v));
  • good
  • bad
  • caught
  • nothing, promise rejects silently
0 voters