Last active
October 27, 2016 10:22
-
-
Save jage/e29ff4ce012a847b1978a193fdbee8ea to your computer and use it in GitHub Desktop.
Exclude exceptions from Sentry by extending the exception
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 "raven" | |
module SentryExcludedException; end | |
Raven.configure do |config| | |
config.dsn = "http://public:secret@localhost/project-id" | |
# Module extensions to be ignored can't be specified as strings | |
config.excluded_exceptions = [SentryExcludedException] | |
end | |
Raven.capture do | |
begin | |
raise StandardError, "oh crap" | |
rescue => error | |
error.extend SentryExcludedException | |
raise | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment