~/talk

Ruby on Fails: effective error handling with...

Talkat RailsConf 2024 · 2024-05-07..05-09· [ruby]
slides:none on file

Argues Rails apps need explicit, intentional error classes (inherit from StandardError, add data, e.g. ItemNotAvailable) and warns rescue_from Exception is dangerous and against using exceptions for normal flow control. Recommends a centralized error reporter via Rails’ subscriber (initializer + report(error, meta)), a module with report_error, using error.cause, layer-supertype errors (CheckoutServiceError → specific errors), as_json conventions, and containing monads/result objects inside use-case services.

AI-written summary · about

  1. 0:00Effective error handling intro
  2. 1:02Ruby exceptions and errors
  3. 2:48Error handling anti-patterns
  4. 5:38Goals for error handling
  5. 6:20Intentional error design
  6. 7:24Discovering error scenarios
  7. 8:29Custom error classes
  8. 9:51Encapsulating errors
  9. 11:16Avoiding leaky abstractions
  10. 12:20Enriching error info
  11. 13:23Fraud detection errors
  12. 14:25Original errors with cause
  13. 15:08Polymorphism for errors
  14. 16:10Layer supertype errors
  15. 17:16Centralized error strategy
  16. 19:00Rails error reporter
  17. 20:25Centralized error reporting
  18. 21:50Rails error logging
  19. 23:17Rails error conventions
  20. 24:19Safe error defaults
  21. 25:44Breaking conventions
  22. 26:47Rails flow strategies
  23. 28:31Key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.