Sha256: 9d2b2f1fa7cf1749eee4142cb961546a2a9d70f12e7c4ab6eeff48b82aaed7fc

Contents?: true

Size: 979 Bytes

Versions: 13

Compression:

Stored size: 979 Bytes

Contents

module Bugsnag::Middleware
  class ExceptionMetaData
    def initialize(bugsnag)
      @bugsnag = bugsnag
    end

    def call(report)
      # Apply the user's information attached to the exceptions
      report.raw_exceptions.each do |exception|
        if exception.class.include?(Bugsnag::MetaData)
          if exception.bugsnag_user_id.is_a?(String)
            report.user = {id: exception.bugsnag_user_id}
          end

          if exception.bugsnag_context.is_a?(String)
            report.context = exception.bugsnag_context
          end

          if exception.bugsnag_grouping_hash.is_a?(String)
            report.grouping_hash = exception.bugsnag_grouping_hash
          end

          if exception.respond_to?(:bugsnag_meta_data) && exception.bugsnag_meta_data
            exception.bugsnag_meta_data.each do |key, value|
              report.add_tab key, value
            end
          end
        end
      end

      @bugsnag.call(report)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bugsnag-6.6.3 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.6.2 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.6.1 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.6.0 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.5.0 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.4.0 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.3.0 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.3.0.beta.0 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.2.0 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.1.1 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.1.0 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.0.1 lib/bugsnag/middleware/exception_meta_data.rb
bugsnag-6.0.0 lib/bugsnag/middleware/exception_meta_data.rb