Created
June 21, 2019 21:20
-
-
Save stevenjackson/c59b57c300daaf9543c4279e64649441 to your computer and use it in GitHub Desktop.
Alert in different envs
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
def record_error(error) | |
error.set_backtrace(Thread.current.backtrace) | |
if Rails.env.development? | |
raise error | |
elsif Rails.env.test? | |
RSpec.current_example.set_exception(error) | |
else | |
Bugsnag.notify(error) do |report| | |
report.severity = 'info' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment