~/talk

Exceptional Ruby

Talkat Ruby on Ales 2011 · 2011-03-24..03-25· [ruby-on-rails]
slides:none on file

Explains concrete behaviors and tools: raise and fail are synonyms and raising follows a four-step raise process (build exception object, set backtrace, set $!, throw). Demonstrates a hammer_time gem error console, shows nested-exception pattern to preserve originals, outlines a circuit-breaker to avoid failure cascades, gives a crash-logger using at_exit, describes a retry use and an exception-safety test harness that records external calls and replays them to force failures.

AI-written summary · about

  1. 0:00Intro
  2. 0:47What is a failure?
  3. 2:23The Definition of Failure cont'd
  4. 2:40Lifecycle of an Exception
  5. 2:54Raising Exceptions
  6. 3:45raise with no arguments
  7. 3:56raise with an error class
  8. 4:17raise is a method on Kernel
  9. 4:31Overriding raise
  10. 4:48Hammertime
  11. 5:17raise internals
  12. 6:34Implement your own #exception()
  13. 7:04set backtrace
  14. 7:19Set $!
  15. 8:09Throw it up the call stack
  16. 8:33rescue with no arguments
  17. 8:52rescue with a class
  18. 9:02rescue with a dynamic matcher
  19. 10:47ensure with explicit return
  20. 11:16retry
  21. 11:48raise during exception handling
  22. 12:00raise a new error
  23. 12:32Nested Exceptions
  24. 13:10Re-raise with the caught error
  25. 13:26Re-raise with new message
  26. 15:32Uncaught exceptions
  27. 15:51A simple crash logger
  28. 17:05Return an error value
  29. 17:32Return a benign value
  30. 18:06Remote Failure Reporting
  31. 20:09Avoid the failure cascade
  32. 21:06Your Failure Handling Strategy
  33. 21:29Exceptions shouldn't be expected
  34. 22:09A rule of thumb for raising
  35. 23:03Use throw for expected cases
  36. 23:57What constitutes an exception?
  37. 24:47Caller-defined failure strategy
  38. 26:03Questions before raising
  39. 26:36Question #4
  40. 29:11Isolate exception handling code
  41. 29:39begin is a code smell
  42. 30:23Method-level exception clauses
  43. 31:18Contingency methods
  44. 32:07Exception Safety
  45. 33:07The Three Guarantees
  46. 33:59When you least expect it
  47. 35:04Exception testing
  48. 35:40Code Under Test
  49. 37:47Be specific when eating exceptions
  50. 38:27Define your own error base class
  51. 39:02What exception classes do I need?
  52. 39:12A Recap
~/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.