Skip to content

Commit

Permalink
Job worker thread logs failed jobs too
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Oct 26, 2012
1 parent 411378e commit 26f52b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/queueing.rb
Expand Up @@ -96,7 +96,7 @@ def run(job)
end

def handle_exception(job, exception)
@logger.error "Job Error: #{exception.message}\n#{exception.backtrace.join("\n")}"
@logger.error "Job Error: #{job.inspect}\n#{exception.message}\n#{exception.backtrace.join("\n")}"
end
end
end
2 changes: 1 addition & 1 deletion activesupport/test/queueing/threaded_consumer_test.rb
Expand Up @@ -68,7 +68,7 @@ def teardown
@queue.drain

assert_equal 1, @logger.logged(:error).size
assert_match 'Job Error: RuntimeError: Error!', @logger.logged(:error).last
assert_match "Job Error: #{job.inspect}\nRuntimeError: Error!", @logger.logged(:error).last
end

test "logger defaults to stderr" do
Expand Down

0 comments on commit 26f52b2

Please sign in to comment.