Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. require 'rollbar'
  2.  
  3. class DeepException < StandardError
  4. def initialize(msg)
  5. super "'#{msg}' from the deep"
  6. end
  7. end
  8.  
  9. class ShallowException < StandardError
  10. def initialize(msg)
  11. super "'#{msg}' from the shallows"
  12. end
  13. end
  14.  
  15. def stack_trace_demo_two
  16. raise DeepException.new("Oops!")
  17. end
  18.  
  19. def stack_trace_demo_one
  20. stack_trace_demo_two
  21. end
  22.  
  23. def chained_trace_two
  24. begin
  25. stack_trace_demo_one
  26. rescue => e
  27. raise ShallowException.new("Oh Well")
  28. end
  29. end
  30.  
  31. def chained_trace_one
  32. chained_trace_two
  33. end
  34.  
  35. Rollbar.configure do |config|
  36. config.access_token = "POST_SERVER_ACCESS_TOKEN"
  37. end
  38.  
  39. begin
  40. chained_trace_one
  41. rescue => e
  42. Rollbar.error e
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement