class ScoutApm::Instant::Middleware

Note that this middleware never even gets inserted unless Rails environment is development (See Railtie)

Public Class Methods

new(app) click to toggle source
# File lib/scout_apm/instant/middleware.rb, line 50
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/scout_apm/instant/middleware.rb, line 54
def call(env)
  rack_response = @app.call(env)
  begin
    DevTraceResponseManipulator.new(env, rack_response).call
  rescue Exception => e
    # If anything went wrong at all, just bail out and return the unmodified response.
    ScoutApm::Agent.instance.context.logger.debug("DevTrace: Raised an exception: #{e.message}, #{e.backtrace}")
    rack_response
  end
end