Sha256: b871e3037ffa8e1bb0d7a27fb07fff3b8bcf776793e6289cac6d642aa924c74e

Contents?: true

Size: 831 Bytes

Versions: 23

Compression:

Stored size: 831 Bytes

Contents

# frozen_string_literal: true

# :markup: markdown

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

23 entries across 23 versions & 2 rubygems

Version Path
actionpack-8.0.1 lib/action_dispatch/middleware/executor.rb
actionpack-8.0.0.1 lib/action_dispatch/middleware/executor.rb
actionpack-7.2.2.1 lib/action_dispatch/middleware/executor.rb
actionpack-8.0.0 lib/action_dispatch/middleware/executor.rb
actionpack-7.2.2 lib/action_dispatch/middleware/executor.rb
actionpack-8.0.0.rc2 lib/action_dispatch/middleware/executor.rb
actionpack-7.2.1.2 lib/action_dispatch/middleware/executor.rb
actionpack-8.0.0.rc1 lib/action_dispatch/middleware/executor.rb
actionpack-7.2.1.1 lib/action_dispatch/middleware/executor.rb
actionpack-8.0.0.beta1 lib/action_dispatch/middleware/executor.rb
omg-actionpack-8.0.0.alpha9 lib/action_dispatch/middleware/executor.rb
omg-actionpack-8.0.0.alpha8 lib/action_dispatch/middleware/executor.rb
omg-actionpack-8.0.0.alpha7 lib/action_dispatch/middleware/executor.rb
omg-actionpack-8.0.0.alpha4 lib/action_dispatch/middleware/executor.rb
omg-actionpack-8.0.0.alpha3 lib/action_dispatch/middleware/executor.rb
omg-actionpack-8.0.0.alpha2 lib/action_dispatch/middleware/executor.rb
omg-actionpack-8.0.0.alpha1 lib/action_dispatch/middleware/executor.rb
actionpack-7.2.1 lib/action_dispatch/middleware/executor.rb
actionpack-7.2.0 lib/action_dispatch/middleware/executor.rb
actionpack-7.2.0.rc1 lib/action_dispatch/middleware/executor.rb