Commit 6ac247f12ae393dac74e9117ae7b1ae7a0a88665

Authored by Kleber Correia
1 parent 326e97bb

Handle update errors

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
lib/searchkick.rb
... ... @@ -112,7 +112,7 @@ module Searchkick
112 112 response = client.bulk(body: items)
113 113 if response["errors"]
114 114 first_with_error = response["items"].map do |item|
115   - (item["index"] || item["delete"])
  115 + (item["index"] || item["delete"] || items['update'])
116 116 end.find { |item| item["error"] }
117 117 raise Searchkick::ImportError, "#{first_with_error["error"]} on item with id '#{first_with_error["_id"]}'"
118 118 end
... ...