跳至内容 跳至搜索
方法
C
N

类公共方法

new(app, executor)

# File actionpack/lib/action_dispatch/middleware/executor.rb, line 9
def initialize(app, executor)
  @app, @executor = app, executor
end

实例公共方法

call(env)

# File actionpack/lib/action_dispatch/middleware/executor.rb, line 13
def call(env)
  state = @executor.run!(reset: true)
  begin
    response = @app.call(env)

    if env["action_dispatch.report_exception"]
      error = env["action_dispatch.exception"]
      @executor.error_reporter.report(error, handled: false, source: "application.action_dispatch")
    end

    returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
  rescue => error
    @executor.error_reporter.report(error, handled: false, source: "application.action_dispatch")
    raise
  ensure
    state.complete! unless returned
  end
end