diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2005-10-15 19:05:15 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2005-10-15 19:05:15 +0000 |
commit | 3625dfaad5901e7595a3541c8ddfe890fefff0a6 (patch) | |
tree | 0d0b8024834e87f7af10b512f942c687b846efd5 /actionpack/lib/action_controller | |
parent | 49ec08aaa76c4d1e5ea3286fa56e4afa927bf135 (diff) | |
download | rails-3625dfaad5901e7595a3541c8ddfe890fefff0a6.tar.gz rails-3625dfaad5901e7595a3541c8ddfe890fefff0a6.tar.bz2 rails-3625dfaad5901e7595a3541c8ddfe890fefff0a6.zip |
Clean up error pages by providing better backtraces
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2624 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml | 15 | ||||
-rw-r--r-- | actionpack/lib/action_controller/templates/rescues/template_error.rhtml | 6 |
2 files changed, 6 insertions, 15 deletions
diff --git a/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml b/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml index 80634b2d34..584659252a 100644 --- a/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml @@ -1,20 +1,9 @@ -<% - clean_backtrace = @exception.backtrace.collect { |line| Object.const_defined?(:RAILS_ROOT) ? line.gsub(RAILS_ROOT, "") : line } - app_trace = clean_backtrace.reject { |line| line =~ /(vendor|dispatch|ruby)/ } - framework_trace = clean_backtrace - app_trace -%> - <h1> <%=h @exception.class.to_s %> in <%=h (@request.parameters["controller"] || "<controller not set>").capitalize %>#<%=h @request.parameters["action"] || "<action not set>" %> </h1> -<pre><%=h Object.const_defined?(:RAILS_ROOT) ? @exception.message.gsub(RAILS_ROOT, "") : @exception.message %></pre> - -<% unless app_trace.empty? %><pre><code><%=h app_trace.join("\n") %></code></pre><% end %> +<pre><%=h @exception.clean_message %></pre> -<% unless framework_trace.empty? %> - <a href="#" onclick="document.getElementById('framework_trace').style.display='block'; return false;">Show framework trace</a> - <pre id="framework_trace" style="display:none"><code><%=h framework_trace.join("\n") %></code></pre> -<% end %> +<%= render_file(@rescues_path + "/_trace.rhtml", false) %> <%= render_file(@rescues_path + "/_request_and_response.rhtml", false) %> diff --git a/actionpack/lib/action_controller/templates/rescues/template_error.rhtml b/actionpack/lib/action_controller/templates/rescues/template_error.rhtml index 074d3a0bc0..2cf812cd5f 100644 --- a/actionpack/lib/action_controller/templates/rescues/template_error.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/template_error.rhtml @@ -13,7 +13,9 @@ <p><%=h @exception.sub_template_message %></p> -<a href="#" onclick="document.getElementById('framework_trace').style.display='block'">Show template trace</a> -<pre id="framework_trace" style="display:none"><code><%=h @exception.original_exception.backtrace.collect { |line| Object.const_defined?(:RAILS_ROOT) ? line.gsub(RAILS_ROOT, "") : line }.join("\n") %></code></pre> +<% @real_exception = @exception + @exception = @exception.original_exception || @exception %> +<%= render_file(@rescues_path + "/_trace.rhtml", false) %> +<% @exception = @real_exception %> <%= render_file(@rescues_path + "/_request_and_response.rhtml", false) %> |