Sha256: c458dd7fbb0ceebae1b905cbd71dc804579117d1a00670d2d3175cea392d2e19

Contents?: true

Size: 996 Bytes

Versions: 49

Compression:

Stored size: 996 Bytes

Contents

module Rollbar
  module ExceptionReporter
    def report_exception_to_rollbar(env, exception)
      exception_message = exception.respond_to?(:message) ? exception.message : 'No Exception Message'
      Rollbar.log_debug "[Rollbar] Reporting exception: #{exception_message}"

      exception_data = Rollbar.log(Rollbar.configuration.uncaught_exception_level, exception, :use_exception_level_filters => true)

      if exception_data.is_a?(Hash)
        env['rollbar.exception_uuid'] = exception_data[:uuid]
        Rollbar.log_debug "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
      elsif exception_data == 'disabled'
        Rollbar.log_debug "[Rollbar] Exception not reported because Rollbar is disabled"
      elsif exception_data == 'ignored'
        Rollbar.log_debug "[Rollbar] Exception not reported because it was ignored"
      end
    rescue => e
      Rollbar.log_warning "[Rollbar] Exception while reporting exception to Rollbar: #{e.message}"
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
rollbar-2.14.1 lib/rollbar/exception_reporter.rb
rollbar-2.14.0 lib/rollbar/exception_reporter.rb
rollbar-2.13.3 lib/rollbar/exception_reporter.rb
rollbar-2.13.2 lib/rollbar/exception_reporter.rb
rollbar-2.13.1 lib/rollbar/exception_reporter.rb
rollbar-2.13.0 lib/rollbar/exception_reporter.rb
rollbar-2.12.0 lib/rollbar/exception_reporter.rb
rollbar-2.11.5 lib/rollbar/exception_reporter.rb
rollbar-2.11.4 lib/rollbar/exception_reporter.rb
rollbar-2.11.3 lib/rollbar/exception_reporter.rb
rollbar-2.11.2 lib/rollbar/exception_reporter.rb
rollbar-2.11.1 lib/rollbar/exception_reporter.rb
rollbar-2.11.0 lib/rollbar/exception_reporter.rb
rollbar-2.10.0 lib/rollbar/exception_reporter.rb
rollbar-2.9.1 lib/rollbar/exception_reporter.rb
rollbar-2.9.0 lib/rollbar/exception_reporter.rb
rollbar-2.8.3 lib/rollbar/exception_reporter.rb
rollbar-2.8.2 lib/rollbar/exception_reporter.rb
rollbar-2.8.1 lib/rollbar/exception_reporter.rb
rollbar-2.8.0 lib/rollbar/exception_reporter.rb