added better error messages for search errors

This commit is contained in:
albert
2012-01-13 18:21:16 -05:00
parent 67484e6c81
commit 28212516df
6 changed files with 15 additions and 4 deletions

View File

@@ -1,7 +1,4 @@
module PostSets
class SearchError < Exception
end
class Post < Base
attr_reader :tag_array, :page
@@ -28,7 +25,7 @@ module PostSets
def posts
if tag_array.size > 2 && !CurrentUser.is_privileged?
raise SearchError
raise SearchError.new("Upgrade your account to search more than two tags at once")
end
@posts ||= ::Post.tag_match(tag_string).paginate(page)

View File

@@ -0,0 +1,4 @@
module PostSets
class SearchError < Exception
end
end