diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-11-04 14:58:07 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-11-04 14:58:07 -0200 |
commit | 8602fc5e11e9fe11ad9a0e307f0fbb438f84b1cc (patch) | |
tree | fb975eae1e0950435dc19d51b78e520193c06a88 /actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | |
parent | 9887a2cfe52f30d4a91e0d16fe57ecf96537b98c (diff) | |
parent | c7f2ee2213b929b2db99da1db801980b38f0e15c (diff) | |
download | rails-8602fc5e11e9fe11ad9a0e307f0fbb438f84b1cc.tar.gz rails-8602fc5e11e9fe11ad9a0e307f0fbb438f84b1cc.tar.bz2 rails-8602fc5e11e9fe11ad9a0e307f0fbb438f84b1cc.zip |
Merge pull request #17480 from gsamokovarov/exception-wrapper-traces
Move DebugExceptions#traces_from_wrapper to ExceptionWrapper
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/exception_wrapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index a6285848b5..e0140b0692 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -57,6 +57,28 @@ module ActionDispatch clean_backtrace(:all) end + def traces + appplication_trace_with_ids = [] + 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 } + + 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 + end + + { + "Application Trace" => appplication_trace_with_ids, + "Framework Trace" => framework_trace_with_ids, + "Full Trace" => full_trace_with_ids + } + end + def self.status_code_for_exception(class_name) Rack::Utils.status_code(@@rescue_responses[class_name]) end |