Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
An async function returns a Promise. Use try/catch around await to handle rejection and decide how the request should fail or recover.
A returned value becomes the fulfilled value of the function's Promise, and a thrown error becomes rejection. await reads a fulfilled result or throws the rejected reason into the current async function. A try/catch around that await can log contextual information and return an appropriate failure response. Starting a Promise without awaiting it or attaching a rejection handler can leave an unhandled rejection.