Sha256: 18e37f544be6f64be3aad41f8922b51fd2f0a3ddbd3e7678181745a98ea0751a

Contents?: true

Size: 717 Bytes

Versions: 9

Compression:

Stored size: 717 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_person_data
              env['rollbar.person_data'] = controller.rollbar_person_data rescue {}
            end
            raise
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rollbar-1.1.0 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-1.0.1 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-1.0.0 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.13.2 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.13.1 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.13.0 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.12.20 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.12.19 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.12.18 lib/rollbar/middleware/rails/rollbar_request_store.rb