What is the correct fix?
fetchUser().then((u) => render(u));
- Add a
.catch((e) => report(e))handler - Add a
.finally((e) => report(e))handler - Wrap the call in a
try/catchblock - Change
.theninto anawaitcall
Without catch a rejection becomes an unhandled promise rejection.
Play Problem Solving ▸