Created
February 11, 2016 15:31
-
-
Save Crisfole/d53c27a28601812012c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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