class Rack::Spec::ErrorHandler

Public Class Methods

new(app) click to toggle source

Behaves as a rack middleware @param app [Object] Rack application

# File lib/rack/spec/error_handler.rb, line 6
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source

Behaves as a rack middleware @param env [Hash] Rack env

# File lib/rack/spec/error_handler.rb, line 12
def call(env)
  @app.call(env)
rescue Rack::Spec::Error => exception
  exception.to_rack_response
end