Ruby on Fails: effective error handling with...
summary
Avoid rescuing rescue from exception or using raises as control flow; create specific error classes that inherit StandardError (example: CheckoutServiceError and item-specific errors) and re-raise gem/AR errors as service-level errors. Subscribe a single error reporter to Rails’ global subscriber and call report_error from an included module so controllers, jobs (Sidekiq) and the app surface consistent metadata. Keep Result/monad patterns inside use-case services only; conventions emit JSON-ready errors for safe defaults.
AI-written summary · about
chapters (12)
- 0:00Effective error handling intro
- 1:02Ruby exceptions and errors
- 2:26Error handling anti-patterns
- 5:36Goals for error handling
- 7:00Discovering error scenarios
- 8:21Explicit error classes
- 10:49Avoiding leaky error handling
- 13:59Polymorphic error handling
- 17:10Centralized error strategy
- 23:27Rails error handling
- 27:00Flow strategies in use cases
- 28:23Key takeaways








