handle some common error cases

This commit is contained in:
albert
2013-03-15 15:18:43 -04:00
parent 85ab44cb80
commit 95e8f02478
4 changed files with 12 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ class PostsController < ApplicationController
rescue_from PostSets::SearchError, :with => :rescue_exception
rescue_from Post::SearchError, :with => :rescue_exception
rescue_from ActiveRecord::StatementInvalid, :with => :rescue_exception
rescue_from ActiveRecord::RecordNotFound, :with => :rescue_exception
def index
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit])