Sha256: cb4c09ea5dc15cbddef52704af9df0edfdad7b47ca593e2bca138f445652ad3e

Contents?: true

Size: 810 Bytes

Versions: 5

Compression:

Stored size: 810 Bytes

Contents

# frozen_string_literal: true

require "rack/body_proxy"

module ActionDispatch
  class Executor
    def initialize(app, executor)
      @app, @executor = app, executor
    end

    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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
actionpack-7.1.5.1 lib/action_dispatch/middleware/executor.rb
actionpack-7.1.5 lib/action_dispatch/middleware/executor.rb
actionpack-7.1.4.2 lib/action_dispatch/middleware/executor.rb
actionpack-7.1.4.1 lib/action_dispatch/middleware/executor.rb
actionpack-7.1.4 lib/action_dispatch/middleware/executor.rb