Sha256: c32e7434bfd2f0ad1f5e9abb7a322b6fc8478977fde7e8a7868ffb19d4692c6a

Contents?: true

Size: 706 Bytes

Versions: 18

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  # @api private
  module Spies
    # @api private
    class ActionDispatchSpy
      def install
        ::ActionDispatch::ShowExceptions.class_eval do
          alias render_exception_without_apm render_exception

          def render_exception(env, exception)
            context = ElasticAPM.build_context(rack_env: env, for_type: :error)
            ElasticAPM.report(exception, context: context, handled: false)

            render_exception_without_apm env, exception
          end
        end
      end
    end

    register(
      'ActionDispatch::ShowExceptions',
      'action_dispatch/show_exception',
      ActionDispatchSpy.new
    )
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
elastic-apm-3.6.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-3.5.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-3.4.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-3.3.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-3.2.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-3.1.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-3.0.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.12.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.11.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.10.1 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.10.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.9.1 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.9.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.8.1 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.8.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.7.0 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.6.1 lib/elastic_apm/spies/action_dispatch.rb
elastic-apm-2.6.0 lib/elastic_apm/spies/action_dispatch.rb