Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #963: slightly_nicer_rescue_templates.diff

File slightly_nicer_rescue_templates.diff, 2.6 kB (added by JohanSörensen, 4 years ago)

for real this time.

  • vendor/rails/actionpack/lib/action_controller/templates/rescues/routing_error.rhtml

    old new  
    11<h1>Routing Error</h1> 
    2 <p><%=h @exception.message %></p> 
     2<p><pre><%=h @exception.message %></pre></p> 
    33<% unless @exception.failures.empty? %><p> 
    44        <h2>Failure reasons:</h2> 
     5        <ol> 
    56        <% @exception.failures.each do |route, reason| %> 
    6                 <%=h route.inspect.gsub('\\', '') %> failed because <%=h reason.downcase %><br /
     7                <li><code><%=h route.inspect.gsub('\\', '') %></code> failed because <%=h reason.downcase %></li
    78  <% end %> 
     9  </ol> 
    810</p><% end %> 
  • vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.rhtml

    old new  
    44</h1> 
    55 
    66<p> 
    7   Showing <i><%=h @exception.file_name %></i> where line <b>#<%=h @exception.line_number %></b> raised 
    8   <u><%=h @exception.message %></u
     7  Showing <i><%=h @exception.file_name %></i> where line <b>#<%=h @exception.line_number %></b> raised: 
     8  <pre><code><%=h @exception.message %></code></pre
    99</p> 
    1010 
    11 <pre><code><%=h @exception.source_extract %></code></pre> 
     11<p>Extracted source (around line <b>#<%=h @exception.line_number %></b>): 
     12<pre><code><%=h @exception.source_extract %></code></pre></p> 
    1213 
    1314<p><%=h @exception.sub_template_message %></p> 
    1415 
  • vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml

    old new  
    88  <%=h @exception.class.to_s %> in 
    99  <%=h (@request.parameters["controller"] || "<controller not set>").capitalize %>#<%=h @request.parameters["action"] || "<action not set>" %> 
    1010</h1> 
    11 <p><%=h Object.const_defined?(:RAILS_ROOT) ? @exception.message.gsub(RAILS_ROOT, "") : @exception.message %></p
     11<pre><%=h Object.const_defined?(:RAILS_ROOT) ? @exception.message.gsub(RAILS_ROOT, "") : @exception.message %></pre
    1212 
    1313<% unless app_trace.empty? %><pre><code><%=h app_trace.join("\n") %></code></pre><% end %> 
    1414