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-4.3.4 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.3.3 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.3.3.pre.beta.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.3.2 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.3.1 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.3.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.2.2 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.2.1 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.2.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.1.7 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.1.6 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.1.5 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.1.4 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.1.3 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.1.2 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.1.1 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.1.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-4.0.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-0.3.0 lib/sentry/rails/backtrace_cleaner.rb
sentry-rails-0.2.0 lib/sentry/rails/backtrace_cleaner.rb