Sha256: afb5ed40dc93c3d9db45e6375d5cb698368337de80c3e57bea96c56c5ba46278

Contents?: true

Size: 531 Bytes

Versions: 12

Compression:

Stored size: 531 Bytes

Contents

module Bugsnag::Middleware
  ##
  # Attaches information about current session to an error report
  class SessionData
    def initialize(bugsnag)
      @bugsnag = bugsnag
    end

    def call(report)
      session = Bugsnag::SessionTracker.get_current_session

      if session && !session[:paused?]
        if report.unhandled
          session[:events][:unhandled] += 1
        else
          session[:events][:handled] += 1
        end

        report.session = session
      end

      @bugsnag.call(report)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bugsnag-6.27.1 lib/bugsnag/middleware/session_data.rb
bugsnag-6.26.4 lib/bugsnag/middleware/session_data.rb
bugsnag-6.26.3 lib/bugsnag/middleware/session_data.rb
bugsnag-6.26.2 lib/bugsnag/middleware/session_data.rb
bugsnag-6.26.1 lib/bugsnag/middleware/session_data.rb
bugsnag-6.26.0 lib/bugsnag/middleware/session_data.rb
bugsnag-6.25.2 lib/bugsnag/middleware/session_data.rb
bugsnag-6.25.1 lib/bugsnag/middleware/session_data.rb
bugsnag-6.25.0 lib/bugsnag/middleware/session_data.rb
bugsnag-6.24.2 lib/bugsnag/middleware/session_data.rb
bugsnag-6.24.1 lib/bugsnag/middleware/session_data.rb
bugsnag-6.24.0 lib/bugsnag/middleware/session_data.rb