forked from rails/rails
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rails#8668 from guilleiguaran/exceptions
New exceptions pages for development
- Loading branch information
Showing
12 changed files
with
258 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<% if @source_extract %> | ||
<div class="source"> | ||
<div class="info"> | ||
Extracted source (around line <strong>#<%= @line_number %></strong>): | ||
</div> | ||
<div class="data"> | ||
<table cellpadding="0" cellspacing="0" class="lines"> | ||
<tr> | ||
<td> | ||
<pre class="line_numbers"> | ||
<% @source_extract.keys.each do |line_number| %> | ||
<span><%= line_number -%></span> | ||
<% end %> | ||
</pre> | ||
</td> | ||
<td width="100%"> | ||
<pre> | ||
<% @source_extract.each do |line, source| -%><div class="line<%= " active" if line == @line_number -%>"><%= source -%></div><% end -%> | ||
</pre> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
<% end %> |
24 changes: 15 additions & 9 deletions
24
actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
<h1> | ||
<%=h @exception.class.to_s %> | ||
<% if @request.parameters['controller'] %> | ||
in <%=h @request.parameters['controller'].camelize %>Controller<% if @request.parameters['action'] %>#<%=h @request.parameters['action'] %><% end %> | ||
<% end %> | ||
</h1> | ||
<pre><%=h @exception.message %></pre> | ||
<header> | ||
<h1> | ||
<%=h @exception.class.to_s %> | ||
<% if @request.parameters['controller'] %> | ||
in <%=h @request.parameters['controller'].camelize %>Controller<% if @request.parameters['action'] %>#<%=h @request.parameters['action'] %><% end %> | ||
<% end %> | ||
</h1> | ||
</header> | ||
|
||
<%= render template: "rescues/_trace" %> | ||
<%= render template: "rescues/_request_and_response" %> | ||
<div id="container"> | ||
<h2><%=h @exception.message %></h2> | ||
|
||
<%= render template: "rescues/_source" %> | ||
<%= render template: "rescues/_trace" %> | ||
<%= render template: "rescues/_request_and_response" %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
<h1>Template is missing</h1> | ||
<p><%=h @exception.message %></p> | ||
<header> | ||
<h1>Template is missing</h1> | ||
</header> | ||
|
||
<div id="container"> | ||
<h2><%=h @exception.message %></h2> | ||
</div> |
41 changes: 22 additions & 19 deletions
41
actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 40 additions & 13 deletions
53
actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,44 @@ | ||
<h1> | ||
<%=h @exception.original_exception.class.to_s %> in | ||
<%=h @request.parameters["controller"].capitalize if @request.parameters["controller"]%>#<%=h @request.parameters["action"] %> | ||
</h1> | ||
<% @source_extract = @exception.source_extract(0, :html) %> | ||
<header> | ||
<h1> | ||
<%=h @exception.original_exception.class.to_s %> in | ||
<%=h @request.parameters["controller"].capitalize if @request.parameters["controller"]%>#<%=h @request.parameters["action"] %> | ||
</h1> | ||
</header> | ||
|
||
<p> | ||
Showing <i><%=h @exception.file_name %></i> where line <b>#<%=h @exception.line_number %></b> raised: | ||
<pre><code><%=h @exception.message %></code></pre> | ||
</p> | ||
<div id="container"> | ||
<p> | ||
Showing <i><%=h @exception.file_name %></i> where line <b>#<%=h @exception.line_number %></b> raised: | ||
<pre><code><%=h @exception.message %></code></pre> | ||
</p> | ||
|
||
<p>Extracted source (around line <b>#<%=h @exception.line_number %></b>): | ||
<pre><code><%=h @exception.source_extract %></code></pre></p> | ||
<div class="source"> | ||
<div class="info"> | ||
<p>Extracted source (around line <strong>#<%=h @exception.line_number %></strong>): | ||
</div> | ||
<div class="data"> | ||
<table cellpadding="0" cellspacing="0" class="lines"> | ||
<tr> | ||
<td> | ||
<pre class="line_numbers"> | ||
<% @source_extract.keys.each do |line_number| %> | ||
<span><%= line_number -%></span> | ||
<% end %> | ||
</pre> | ||
</td> | ||
<td width="100%"> | ||
<pre> | ||
<% @source_extract.each do |line, source| -%><div class="line<%= " active" if line == @exception.line_number -%>"><%= source -%></div><% end -%> | ||
</pre> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
|
||
<p><%=h @exception.sub_template_message %></p> | ||
<p><%=h @exception.sub_template_message %></p> | ||
|
||
<%= render template: "rescues/_trace" %> | ||
<%= render template: "rescues/_request_and_response" %> | ||
<%= render template: "rescues/_trace" %> | ||
<%= render template: "rescues/_request_and_response" %> | ||
</div> | ||
</div> |
8 changes: 6 additions & 2 deletions
8
actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
<h1>Unknown action</h1> | ||
<p><%=h @exception.message %></p> | ||
<header> | ||
<h1>Unknown action</h1> | ||
</header> | ||
<div id="container"> | ||
<h2><%=h @exception.message %></h2> | ||
</div> |
Oops, something went wrong.