Skip to content

Commit

Permalink
Merge pull request collectiveidea#815 from elitau/rescue_exception_in…
Browse files Browse the repository at this point in the history
…_worker

Rescue exception in worker (now with fixed rubocop warning)
  • Loading branch information
albus522 committed Sep 14, 2015
2 parents e81abd1 + 703d28c commit 3b07202
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/delayed/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def run(job)
rescue DeserializationError => error
job.error = error
failed(job)
rescue => error
rescue Exception => error # rubocop:disable RescueException
self.class.lifecycle.run_callbacks(:error, self, job) { handle_failed_job(job, error) }
return false # work failed
end
Expand Down
2 changes: 1 addition & 1 deletion spec/sample_jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ErrorJob
cattr_accessor :runs
@runs = 0
def perform
raise 'did not work'
raise Exception, 'did not work'
end
end

Expand Down

0 comments on commit 3b07202

Please sign in to comment.