我在生产日志中不断收到此错误(没有任何回溯):
Feature: YouTube has a search function.
Scenario: Search for a term # features/youtube_search.feature:3
Given I am on Youtube # features/step_definitions/youtube_search_steps.rb:1
undefined method `delete' for nil:NilClass (NoMethodError)
./features/step_definitions/youtube_search_steps.rb:2:in `/^I am on Youtube$/'
features/youtube_search.feature:4:in `Given I am on Youtube'
When I fill in "search_query" with "text adventure" # features/step_definitions/youtube_search_steps.rb:5
And I press "search-btn" # features/step_definitions/youtube_search_steps.rb:9
Then I should see "GET LAMP: The Text Adventure Documentary" # features/step_definitions/youtube_search_steps.rb:13
Failing Scenarios:
cucumber features/youtube_search.feature:3 # Scenario: Search for a term
1 scenario (1 failed)
4 steps (1 failed, 3 skipped)
0m1.898s
根据我的理解,这意味着registered error handler正在引发异常。
但是我的应用程序没有任何自定义错误处理程序。
如何调试/解决此问题?
我的应用程序如下所示:
!!! ERROR HANDLER THREW AN ERROR !!!
因此,在我的日志中,我经常会看到类似的内容:
https://example.com/path的传递错误:SSL连接错误等
其次是:
class DeliveryJob
include Sidekiq::Worker
sidekiq_options queue: :deliveries, retry: 3
sidekiq_retry_in { |count| 20 * (3 ** count) }
sidekiq_retries_exhausted do |s|
# do something (some methods use Redis) ...
Rails.logger.tagged('delivery') do
Rails.logger.error "Sidekiq retries exhausted for ..."
end
end
def perform(id)
Notification.find(id).deliver
end
end
class Notification
def deliver
# do something that may fail
rescue => e
Rails.logger.tagged('delivery') do
Rails.logger.error "Delivery error for #{endpoint}: #{e.to_s}"
end
raise e
end
end
!!! ERROR HANDLER THREW AN ERROR !!!
是可以预期的,但我不明白为什么我从错误处理程序中收到错误。
答案 0 :(得分:0)