aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/exception_wrapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/middleware/exception_wrapper.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
index e0140b0692..b8381aba70 100644
--- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
+++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
@@ -62,14 +62,12 @@ module ActionDispatch
framework_trace_with_ids = []
full_trace_with_ids = []
- if full_trace
- full_trace.each_with_index do |trace, idx|
- trace_with_id = { id: idx, trace: trace }
+ full_trace.each_with_index do |trace, idx|
+ trace_with_id = { id: idx, trace: trace }
- appplication_trace_with_ids << trace_with_id if application_trace.include?(trace)
- framework_trace_with_ids << trace_with_id if framework_trace.include?(trace)
- full_trace_with_ids << trace_with_id
- end
+ appplication_trace_with_ids << trace_with_id if application_trace.include?(trace)
+ framework_trace_with_ids << trace_with_id if framework_trace.include?(trace)
+ full_trace_with_ids << trace_with_id
end
{
@@ -84,7 +82,7 @@ module ActionDispatch
end
def source_extract
- exception.backtrace.map do |trace|
+ backtrace.map do |trace|
file, line = trace.split(":")
line_number = line.to_i
{
@@ -92,11 +90,15 @@ module ActionDispatch
file: file,
line_number: line_number
}
- end if exception.backtrace
+ end
end
private
+ def backtrace
+ Array(@exception.backtrace)
+ end
+
def original_exception(exception)
if registered_original_exception?(exception)
exception.original_exception
@@ -111,9 +113,9 @@ module ActionDispatch
def clean_backtrace(*args)
if backtrace_cleaner
- backtrace_cleaner.clean(@exception.backtrace, *args)
+ backtrace_cleaner.clean(backtrace, *args)
else
- @exception.backtrace
+ backtrace
end
end