Fix 404/timeout errors not showing

This commit is contained in:
Toks
2014-11-25 21:04:03 -05:00
parent dd714d5bf6
commit 91270f4567
2 changed files with 2 additions and 2 deletions

View File

@@ -32,11 +32,9 @@ protected
@exception = exception
if exception.is_a?(::ActiveRecord::StatementInvalid) && exception.to_s =~ /statement timeout/
@exception = nil
@error_message = "The database timed out running your query."
render :template => "static/error", :status => 500
elsif exception.is_a?(::ActiveRecord::RecordNotFound)
@exception = nil
@error_message = "That record was not found"
render :template => "static/error", :status => 404
else

View File

@@ -6,6 +6,8 @@
<li style="list-style-type: none;"><%= b %></li>
<%- end -%>
</ul>
<% elsif @error_message %>
<p><%= @error_message %></p>
<% else %>
<p><%= @exception.message %></p>
<% end %>