Skip to main content
JavaScript Interview Questions Concept Queue P0 Medium

The catch block that never catches

An async function wraps return loadAccount() in try/catch. Assume loadAccount returns a promise that rejects asynchronously. The caller sees a rejection instead of the fallback in catch. Explain why and how you would fix it.

Official Reference

Model Answer & Explanation

Returning the promise lets the async function adopt its eventual rejection, but no exception is thrown while executing that try block. Write return await loadAccount() inside try so the rejection is thrown at the await expression and caught locally. A synchronous throw while calling loadAccount would already be caught by the original code.

What a Strong Answer Covers

  • Distinguish a rejected promise from a synchronous throw.
  • Explain why awaiting inside the try lets the local catch run.
Follow-up Interview Question · Where should the error be handled if only the caller knows the appropriate fallback?

Module Context & References

JavaScript · Applied concepts Debug real scenarios and explain the rule behind each fix.
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.