Skip to content

Commit 19cf039

Browse files
algolia-botmillotp
andcommitted
fix(ruby): handle unknown attributes in index_exists (generated)
algolia/api-clients-automation#4231 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 187e4ab commit 19cf039

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/algolia/api/search_client.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3533,13 +3533,16 @@ def replace_all_objects(index_name, objects, batch_size = 1000, request_options
35333533
def index_exists?(index_name)
35343534
begin
35353535
get_settings(index_name)
3536-
rescue AlgoliaHttpError => e
3537-
return false if e.code == 404
3536+
rescue Exception => e
3537+
if e.is_a?(AlgoliaHttpError)
3538+
return false if e.code == 404
35383539

3539-
raise e
3540+
raise e
3541+
end
35403542
end
35413543

35423544
true
35433545
end
3546+
35443547
end
35453548
end

0 commit comments

Comments
 (0)