Skip to content

Instantly share code, notes, and snippets.

@Crisfole
Created February 11, 2016 15:31
Show Gist options
  • Save Crisfole/d53c27a28601812012c9 to your computer and use it in GitHub Desktop.
Save Crisfole/d53c27a28601812012c9 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment