Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rollbar'
- class DeepException < StandardError
- def initialize(msg)
- super "'#{msg}' from the deep"
- end
- end
- class ShallowException < StandardError
- def initialize(msg)
- super "'#{msg}' from the shallows"
- end
- end
- def stack_trace_demo_two
- raise DeepException.new("Oops!")
- end
- def stack_trace_demo_one
- stack_trace_demo_two
- end
- def chained_trace_two
- begin
- stack_trace_demo_one
- rescue => e
- raise ShallowException.new("Oh Well")
- end
- end
- def chained_trace_one
- chained_trace_two
- end
- Rollbar.configure do |config|
- config.access_token = "POST_SERVER_ACCESS_TOKEN"
- end
- begin
- chained_trace_one
- rescue => e
- Rollbar.error e
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement