Skip to content

Commit

Permalink
Use :use_exception_level_filters in ActiveJob plugin
Browse files Browse the repository at this point in the history
Fix #531
  • Loading branch information
Jon de Andres committed Sep 20, 2016
1 parent 1a9f37b commit e7e0bf4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/rollbar/plugins/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ module Rollbar
module ActiveJob
def self.included(base)
base.send :rescue_from, Exception do |exception|
Rollbar.error(exception, :job => self.class.name, :job_id => job_id)
Rollbar.error(exception,
:job => self.class.name,
:job_id => job_id,
:use_exception_level_filters => true)
raise exception
end
end
Expand Down
6 changes: 5 additions & 1 deletion spec/rollbar/plugins/active_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ def perform(exception, job_id)
let(:job_id) { "123" }

it "reports the error to Rollbar" do
expected_params = { :job => "TestJob", :job_id => job_id }
expected_params = {
:job => "TestJob",
:job_id => job_id,
:use_exception_level_filters => true
}
expect(Rollbar).to receive(:error).with(exception, expected_params)
TestJob.new.perform(exception, job_id) rescue nil
end
Expand Down

0 comments on commit e7e0bf4

Please sign in to comment.