add special clause for timeouts on post searches
This commit is contained in:
@@ -10,6 +10,13 @@ class PostsController < ApplicationController
|
||||
respond_with(@posts) do |format|
|
||||
format.atom
|
||||
end
|
||||
rescue ::ActiveRecord::StatementInvalid => e
|
||||
if e.to_s =~ /statement timeout/
|
||||
@error_message = "The database timed out running your query. Try a simpler query that returns fewer results."
|
||||
render :action => "error"
|
||||
else
|
||||
raise
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
<p>Error: <%= @exception.to_s %></p>
|
||||
<% if @error_message %>
|
||||
<p><%= @error_message %></p>
|
||||
<% else %>
|
||||
<p>Error: <%= @exception.to_s %></p>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user