Parece simples até o entrevistador perguntar "why?". Abaixo, uma estrutura de resposta que dá conta do follow-up.
Use try/catch around awaited operations. A rejection at an await throws into the surrounding catch. Handle a recoverable failure or rethrow with useful context. Log at an appropriate boundary without duplicating the same failure at every layer or exposing secrets.
A promise started without awaiting it is not covered by that local catch when it later rejects. Returning it lets the caller observe the rejection, but return promise does not make the local try/catch intercept that later rejection. Use await inside the try when local handling is required. Attach a rejection handler to intentionally independent work.
Ler é o primeiro passo. No app, essa pergunta vira flashcard com repetição espaçada, e o módulo tem quiz e simulado para testar o que ficou.
Treinar essa pergunta no app