Skip to content

Instantly share code, notes, and snippets.

@jage
Last active October 27, 2016 10:22
Show Gist options
  • Save jage/e29ff4ce012a847b1978a193fdbee8ea to your computer and use it in GitHub Desktop.
Save jage/e29ff4ce012a847b1978a193fdbee8ea to your computer and use it in GitHub Desktop.
Exclude exceptions from Sentry by extending the exception
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