Skip to content

Commit

Permalink
better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Dec 24, 2020
1 parent 9b9751f commit fdef14b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/jobs/index_background_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class IndexBackgroundJob < ApplicationJob

def perform(obj)
response = obj.__elasticsearch__.index_document
Rails.logger.error "[Elasticsearch] Error indexing id #{response["_id"]} in index #{response["_index"]}" if response["result"] != "created"
# Rails.logger.error "[Elasticsearch] Error indexing id #{response["_id"]} in index #{response["_index"]}" if response["result"] != "created"
Rails.logger.error "[Elasticsearch] Error #{response.inspect}" if response["result"] != "created"
end
end
3 changes: 2 additions & 1 deletion app/jobs/index_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class IndexJob < ApplicationJob

def perform(obj)
response = obj.__elasticsearch__.index_document
Rails.logger.error "[Elasticsearch] Error indexing id #{response["_id"]} in index #{response["_index"]}" if response["result"] != "created"
# Rails.logger.error "[Elasticsearch] Error indexing id #{response["_id"]} in index #{response["_index"]}" if response["result"] != "created"
Rails.logger.error "[Elasticsearch] Error #{response.inspect}" if response["result"] != "created"
end
end

0 comments on commit fdef14b

Please sign in to comment.