aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/exception.rb
blob: 323d97aa44cc1b27b8445b173e88fe5df82488dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class Exception
  
  alias :clean_message :message
  
  TraceSubstitutions = []
  
  def clean_backtrace
    backtrace.collect do |line|
      TraceSubstitutions.inject(line) do |line, (regexp, sub)|
        line.gsub regexp, sub
      end
    end
  end
  
  def application_backtrace
    clean_backtrace.reject { |line| line =~ /(vendor|dispatch|ruby|script\/\w+)/ }
  end
end