~/talk

Exceptional Ruby

Talkat LoneStarRuby Conf 2011 · 2011-08-11..08-13· [ruby]
slides:none on file

Deep dive into Ruby exceptions: explains raise internals (four steps, .exception coercion, $! backtrace handling), shows quirks (rescue only catches StandardError, ensure with explicit return swallows exceptions), demos that were built (hammer_time gem interactive error console) and patterns that scale (nested exceptions, module tagging of bubbled errors, atexit logging of gem versions, circuit‑breaker cautionary tale), and recommends structuring errors as three exception classes (user, logic, transient) with contingency methods and verifiable exception‑safety levels.

AI-written summary · about

  1. 0:00Intro
  2. 0:29What is a failure?
  3. 1:42The Definition of Failure cont'd
  4. 1:59Lifecycle of an Exception
  5. 2:10Raising Exceptions
  6. 3:06raise with a string
  7. 3:17raise with a custom backtrace
  8. 3:37raise is a method on Kernel
  9. 3:53Overriding raise
  10. 4:12Hammertime
  11. 4:43raise internals
  12. 6:16Implement your own #exception()
  13. 6:52set backtrace
  14. 7:50Throw it up the call stack
  15. 8:06rescue with no arguments
  16. 8:41rescue with a class
  17. 9:05rescue with a dynamic matcher
  18. 11:18raise during exception handling
  19. 11:28raise a new error
  20. 12:00Nested Exceptions
  21. 12:38Re-raise with the caught error
  22. 13:18Re-raise with message, backtrace
  23. 13:36Disallowing double-raise
  24. 14:37Using NoDoubleRaise
  25. 14:53Uncaught exceptions
  26. 15:27A simple crash logger
  27. 16:20Responding to Failures
  28. 16:36Return an error value
  29. 16:48Return a benign value
  30. 17:09Remote Failure Reporting
  31. 19:21Avoid the failure cascade
  32. 19:40Your Failure Handling Strategy
  33. 20:23Question #1
  34. 21:31Use throw for expected cases
  35. 22:55Question #2
  36. 23:52What constitutes an exception?
  37. 24:37Caller-defined fallback strategy
  38. 25:52Question #4
  39. 27:00Isolate exception handling code
  40. 27:26begin is a code smell
  41. 27:54Method-level exception clauses
  42. 28:31Contingency methods
  43. 29:12When you least expect it
  44. 30:01Exception Safety
  45. 30:28The Three Guarantees
  46. 31:44Be specific when eating exceptions
  47. 32:33Tag your library exceptions
  48. 33:56What exception classes do I need?
  49. 35:07User Error
  50. 35:27Logic Error
  51. 35:43Transient Error
  52. 36:15Three essential exception classes
  53. 36:53A Recap
  54. 37:08Thank You!
~/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.