Sha256: ba4477b9ff9f06541e527ab1f86bf0adc9b1c6fdddae7d36dd7ec232584d8134

Contents?: true

Size: 756 Bytes

Versions: 5

Compression:

Stored size: 756 Bytes

Contents

require 'rollbar/exception_reporter'
require 'rollbar/request_data_extractor'

module Pliny
  module ErrorReporters
    class Rollbar
      include ::Rollbar::ExceptionReporter
      include ::Rollbar::RequestDataExtractor

      def notify(exception, context:, rack_env:)
        ::Rollbar.reset_notifier!
        scope = fetch_scope(context: context, rack_env: rack_env)
        ::Rollbar.scoped(scope) do
          report_exception_to_rollbar(rack_env, exception)
        end
      end

      private

      def fetch_scope(context:, rack_env:)
        {
          request: proc { extract_request_data_from_rack(rack_env) }
        }
      rescue Exception => e
        report_exception_to_rollbar(rack_env, e)
        raise
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pliny-0.20.2 lib/pliny/error_reporters/rollbar.rb
pliny-0.20.1 lib/pliny/error_reporters/rollbar.rb
pliny-0.20.0 lib/pliny/error_reporters/rollbar.rb
pliny-0.19.0 lib/pliny/error_reporters/rollbar.rb
pliny-0.18.0 lib/pliny/error_reporters/rollbar.rb