class ConfigurableExceptions::Middleware
No way of toggling config.action_dispatch.show_exceptions directly it appears so this configurable middleware is instead injected before the exception middleware to be able to dynamically switch them on/off for testing
Public Class Methods
new(app)
click to toggle source
# File lib/configurable_exceptions/middleware.rb, line 6 def initialize(app) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/configurable_exceptions/middleware.rb, line 10 def call(env) env['action_dispatch.show_exceptions'] = ConfigurableExceptions.show_exceptions @app.call(env) end