You’re Doing Exceptions Wrong
summary
Four practical categories determine how to handle errors: fatal vs boneheaded vs vexing vs exogenous — treat out-of-memory and stack overflow as process-killers, prevent null reference/index-out-of-range bugs instead of catching them, convert APIs that throw (use TryParse rather than int.Parse) or catch the exception right at the source (Cosmos DB read throws a 404 for missing docs), and never swallow external IO failures (don’t return zero on error). Use retries for specific codes like 503 with libraries such as Polly, and preserve stack trace with throw;.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 2:19Exceptions are good usually
- 8:20Fatal exceptions and crashes
- 11:06Boneheaded exceptions
- 19:12Helpful exception messages
- 23:45Avoid harmful error messages
- 29:41Debug assertions vs boneheaded
- 33:33Vexing exceptions and API pitfalls
- 37:48Exogenous exceptions
- 39:55Never hide exceptions
- 44:09Where to handle exceptions
- 48:09Retry logic for exceptions
- 51:39Preserve stack traces with finally
- 54:31Exception categories recap
- 56:57Q&A








