diff --git a/lib/sidekiq_middlewares.rb b/lib/sidekiq_middlewares.rb index c744c9105038c20cb5304db5f13025bf42705a16..6190cff4a81480c96a7ad1a2b0003eca35f0f115 100644 --- a/lib/sidekiq_middlewares.rb +++ b/lib/sidekiq_middlewares.rb @@ -5,7 +5,8 @@ module SidekiqMiddlewares rescue Exception backtrace = Rails.backtrace_cleaner.clean($!.backtrace) backtrace.reject! { |line| line =~ /lib\/sidekiq_middlewares.rb/ } - limit = AppConfig.environment.sidekiq.backtrace.to_i + limit = AppConfig.environment.sidekiq.backtrace.get + limit = limit ? limit.to_i : 0 backtrace = [] if limit == 0 raise $!, $!.message, backtrace[0..limit] end