Async/await:
- Prefer
async/await over .then()/.catch()
- Always use try/catch with await
- Use
logger.errorAndReport() for error tracking, except for Apollo errors: the shell's Apollo client reports those (Who reports an error)
- Use
Promise.all() for concurrent operations
Error handling:
- Normalize errors:
err instanceof Error ? err : new Error(String(err))
- Log context with errors
- Re-throw when caller needs to handle
Async/Await Over Promises
Promise.all() for Concurrent Operations
For more detailed technical guidance, see these reference files: