-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi there!
Would be nice to have request failures exposed, for instance:
result = SomeIndex.search(query: 'something', query_by: 'typo_here')
=> #<Typesensual::Search::Results:0x00007f721ca676c0 @results={"code"=>404, "error"=>"Could not find a field named `typo_here` in the schema."}>
result.hits
Traceback (most recent call last):
1: from (irb):51
NoMethodError (undefined method `map' for nil:NilClass)
result.results
Traceback (most recent call last):
1: from (irb):54
NoMethodError (undefined method `results' for #<Typesensual::Search::Results:0x00007f721ca676c0>)I had to workaround that with:
if result.count.nil?
raise RequestFailed, result.instance_variable_get(:@results).inspect
endMetadata
Metadata
Assignees
Labels
No labels