summaryrefslogtreecommitdiff
path: root/lib/chef_zero/solr/solr_parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef_zero/solr/solr_parser.rb')
-rw-r--r--lib/chef_zero/solr/solr_parser.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef_zero/solr/solr_parser.rb b/lib/chef_zero/solr/solr_parser.rb
index 936ead1..99da5fe 100644
--- a/lib/chef_zero/solr/solr_parser.rb
+++ b/lib/chef_zero/solr/solr_parser.rb
@@ -7,6 +7,8 @@ require 'chef_zero/solr/query/subquery'
module ChefZero
module Solr
+ class ParseError < RuntimeError; end
+
class SolrParser
def initialize(query_string)
@query_string = query_string
@@ -114,7 +116,7 @@ module ChefZero
end
def parse_error(token, str)
- raise "Error on token '#{token}' at #{@index} of '#{@query_string}': #{str}"
+ raise ChefZero::Solr::ParseError, "Error on token '#{token}' at #{@index} of '#{@query_string}': #{str}"
end
def read_single_expression