Avoiding Disaster: Practical Strategies for Error Handling Slides
summary
Builds a simple ticket‑purchase web flow and replaces ad hoc exception checks with a tiny Ruby pattern: service objects that return a monadic result object (success/value or failure/error), implemented via a base MonicService and concrete services like create_order and checkout_order. Controllers now inspect result.success? and render standardized error payloads instead of rescuing many exception types. Claim: this reduces branching, improves reuse and readability, and keeps expected errors explicit while reserving exceptions for truly unexpected failures.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:05Understanding errors
- 3:39Expected vs unexpected
- 5:26Naive error handling
- 9:03Refactoring business logic
- 12:36Inconsistent error handling
- 14:01Monadic error handling
- 17:12Service objects with monadic results
- 20:48When to use monads
- 23:19Validity and execution errors
- 24:24Summary








