Sha256: 70f42324e8002b081bcf8f70b8d54876556cd042a2937485fa8d5fe3fde23f40
Contents?: true
Size: 827 Bytes
Versions: 6
Compression:
Stored size: 827 Bytes
Contents
# frozen_string_literal: true module PlainApm module Extensions module Exceptions class Rack include EventAttributes def initialize(app) @app = app end def call(env) response = @app.call(env) e = env["action_dispatch.exception"] report_exception(e, env) unless e.nil? response rescue Exception => e # standard:disable Lint/RescueException report_exception(e, env) raise end private def report_exception(e, env) source, event = attributes_from_exception(e, {env: env}, nil) return if event.nil? event[:source] = source event[:name] = "rack_middleware" PlainApm.agent.collect(event) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems