Sha256: d3015186fba575d824dbc9e633890c1b3ca357e8ea390759c7fc27dd3381497a

Contents?: true

Size: 838 Bytes

Versions: 82

Compression:

Stored size: 838 Bytes

Contents

require "active_support/backtrace_cleaner"
require "active_support/core_ext/string/access"

module Sentry
  module Rails
    class BacktraceCleaner < ActiveSupport::BacktraceCleaner
      APP_DIRS_PATTERN = /\A(?:\.\/)?(?:app|config|lib|test|\(\w*\))/.freeze
      RENDER_TEMPLATE_PATTERN = /:in `.*_\w+_{2,3}\d+_\d+'/.freeze

      def initialize
        super
        # we don't want any default silencers because they're too aggressive
        remove_silencers!

        @root = "#{Sentry.configuration.project_root}/"
        add_filter do |line|
          line.start_with?(@root) ? line.from(@root.size) : line
        end
        add_filter do |line|
          if line =~ RENDER_TEMPLATE_PATTERN
            line.sub(RENDER_TEMPLATE_PATTERN, "")
          else
            line
          end
        end
      end
    end
  end
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
sentry-rails-5.20.1 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.20.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.19.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.18.2 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.18.1 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.18.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.17.3 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.17.2 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.17.1 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.17.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.16.1 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.15.2 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.15.1 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.15.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.14.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.13.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.12.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.11.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.10.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-5.9.0 lib/sentry/rails/backtrace_cleaner.rb