Module: Cucumber::Rails::ActionDispatch::ShowExceptions

Defined in:
lib/cucumber/rails/action_dispatch.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cucumber/rails/action_dispatch.rb', line 11

def call(env)
  env['action_dispatch.show_detailed_exceptions'] = !ActionController::Base.allow_rescue

  show_exceptions = !env['action_dispatch.show_detailed_exceptions']
  if ::Rails.gem_version >= Gem::Version.new('7.1.0')
    # Rails 7.1 deprecated `show_exceptions` boolean in in favor of symbols
    show_exceptions = show_exceptions ? :all : :none
  end

  env['action_dispatch.show_exceptions'] = show_exceptions
  super(env)
end