Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/rocket_pants/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ class Base < ActionController::Metal
rescue LoadError
end

# If possible, include Raven methods in the Rails controller
begin
require 'sentry-raven'
require 'sentry-raven/rails/controller_methods'
MODULES << Raven::Rails::ControllerMethods
rescue LoadError => e
end

MODULES.each do |mixin|
include mixin
end
Expand Down
3 changes: 3 additions & 0 deletions lib/rocket_pants/controller/rescuable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ module Rescuable
},
:bugsnag => lambda { |controller, exception, request|
controller.send(:notify_bugsnag, exception, request: request)
},
:sentry => lambda { |_, exception, _|
Raven.capture_exception(exception)
}
}

Expand Down