aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/exception.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/exception.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/exception.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/exception.rb b/activesupport/lib/active_support/core_ext/exception.rb
new file mode 100644
index 0000000000..323d97aa44
--- /dev/null
+++ b/activesupport/lib/active_support/core_ext/exception.rb
@@ -0,0 +1,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 \ No newline at end of file