Navigation Menu

Skip to content

Commit

Permalink
search: handle incompatible encoding error
Browse files Browse the repository at this point in the history
It may be occurred when inspecting object to generate error message.
  • Loading branch information
kou committed Apr 10, 2014
1 parent d023dc8 commit 4eda6a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/droonga/searcher.rb
Expand Up @@ -291,9 +291,14 @@ def parse_condition_hash(source, expression, condition)
if condition["allowColumn"]
options[:allow_column] = true
end
syntax_errors = [
Groonga::SyntaxError,
Groonga::InvalidArgument,
Encoding::CompatibilityError,
]
begin
expression.parse(query, options)
rescue Groonga::SyntaxError, Groonga::InvalidArgument
rescue *syntax_errors
raise SyntaxError.new("query", query)
end
elsif condition["script"]
Expand Down

0 comments on commit 4eda6a6

Please sign in to comment.