Fix 404/timeout errors not showing
This commit is contained in:
@@ -32,11 +32,9 @@ protected
|
|||||||
@exception = exception
|
@exception = exception
|
||||||
|
|
||||||
if exception.is_a?(::ActiveRecord::StatementInvalid) && exception.to_s =~ /statement timeout/
|
if exception.is_a?(::ActiveRecord::StatementInvalid) && exception.to_s =~ /statement timeout/
|
||||||
@exception = nil
|
|
||||||
@error_message = "The database timed out running your query."
|
@error_message = "The database timed out running your query."
|
||||||
render :template => "static/error", :status => 500
|
render :template => "static/error", :status => 500
|
||||||
elsif exception.is_a?(::ActiveRecord::RecordNotFound)
|
elsif exception.is_a?(::ActiveRecord::RecordNotFound)
|
||||||
@exception = nil
|
|
||||||
@error_message = "That record was not found"
|
@error_message = "That record was not found"
|
||||||
render :template => "static/error", :status => 404
|
render :template => "static/error", :status => 404
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
<li style="list-style-type: none;"><%= b %></li>
|
<li style="list-style-type: none;"><%= b %></li>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
</ul>
|
</ul>
|
||||||
|
<% elsif @error_message %>
|
||||||
|
<p><%= @error_message %></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p><%= @exception.message %></p>
|
<p><%= @exception.message %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user