Sha256: 77c2e863cc07652c148d035feec754ad2cbd500d2c74a68c35d879c464ca3327

Contents?: true

Size: 744 Bytes

Versions: 4

Compression:

Stored size: 744 Bytes

Contents

module Rollbar
  module Middleware
    module Rails
      # Middleware that ensures any database calls to load data for exception reports
      # are done before connections are cleaned up by the rake connection pool middleware
      class RollbarRequestStore
        def initialize(app)
          @app = app
        end
        
        def call(env)
          begin
            @app.call(env)
          rescue
            controller = env["action_controller.instance"]
            if controller and controller.respond_to? Rollbar.configuration.person_method
              env['rollbar.person_data'] = controller.send(Rollbar.configuration.person_method)
            end
            raise
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rollbar-0.12.2 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.12.1 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.12.0 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.11.8 lib/rollbar/middleware/rails/rollbar_request_store.rb