-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't let #{application,framework,full}_trace be nil
Those three can be nil when exception backtrace is nil. This happens and that forced a couple of nil guards in the code. I'm proposing to make those always return an array, even on nil backtrace.
- Loading branch information
1 parent
4b4dca4
commit e05714f
Showing
3 changed files
with
62 additions
and
31 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
38 changes: 18 additions & 20 deletions
38
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 |
---|---|---|
@@ -1,29 +1,27 @@ | ||
<% if @source_extract %> | ||
<% @source_extract.each_with_index do |extract_source, index| %> | ||
<% if extract_source[:code] %> | ||
<div class="source <%="hidden" if @show_source_idx != index%>" id="frame-source-<%=index%>"> | ||
<div class="info"> | ||
Extracted source (around line <strong>#<%= extract_source[:line_number] %></strong>): | ||
</div> | ||
<div class="data"> | ||
<table cellpadding="0" cellspacing="0" class="lines"> | ||
<tr> | ||
<td> | ||
<pre class="line_numbers"> | ||
<% extract_source[:code].each_key do |line_number| %> | ||
<% @source_extract.each_with_index do |extract_source, index| %> | ||
<% if extract_source[:code] %> | ||
<div class="source <%="hidden" if @show_source_idx != index%>" id="frame-source-<%=index%>"> | ||
<div class="info"> | ||
Extracted source (around line <strong>#<%= extract_source[:line_number] %></strong>): | ||
</div> | ||
<div class="data"> | ||
<table cellpadding="0" cellspacing="0" class="lines"> | ||
<tr> | ||
<td> | ||
<pre class="line_numbers"> | ||
<% extract_source[:code].each_key do |line_number| %> | ||
<span><%= line_number -%></span> | ||
<% end %> | ||
</pre> | ||
</td> | ||
<% end %> | ||
</pre> | ||
</td> | ||
<td width="100%"> | ||
<pre> | ||
<% extract_source[:code].each do |line, source| -%><div class="line<%= " active" if line == extract_source[:line_number] -%>"><%= source -%></div><% end -%> | ||
</pre> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</tr> | ||
</table> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% end %> |
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