Failing Successfully: Reporting and Handling Errors
summary
Argues for precise error contracts: prefer fail fast and fail often, keep low-level APIs returning error codes and hand up rich context so higher layers can decide whether to treat a condition as fatal, and use exceptions only where the application-level semantics make failures exceptional. Shows concrete failures of a_to_i/strtol/from_chars, demos std::error_code/system_error, a threadsafe thread pool that fans exceptions back to main, and a processor manager that treats EOF as successful shutdown when appropriate.
AI-written summary · about
chapters (20)
- 0:00Intro
- 1:58Alternatives
- 9:08Real 8I
- 14:20Broad Classes of Failure
- 17:14Error Enumeration
- 19:54SystemError
- 20:53Exceptions
- 22:45What if
- 23:55Writing a fixed message reader
- 26:52Multithreading
- 27:48Thread Pool
- 31:53Network Server
- 32:40Who is the error
- 33:36Success or failure
- 38:36Warnings Logging
- 40:48Takeaways
- 41:25Questions
- 42:26The lowest hanging fruit
- 44:08Out parameter
- 45:43Capturing context
related talks
48mHow to make error handling less error-prone
32mThe Absurdity of Error Handling: Finding a Purpose for Errors in Safety-Critical SYCL
57mError handling: doing it right!
01h 03mExceptionally Bad: The Misuse of Exceptions in C++ & How to Do Better
22mWhat Could Go Wrong? The Subtle Science Of Coding for Failure
48mSecure C++ Programming
51mSecure Programming Practices in C++
59m“The Exception Situation"
