From 4a844286205422ae1311fd6362db0117f547e2f1 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sat, 5 Jun 2021 10:18:06 +0200 Subject: [PATCH] more information in error logging --- app/jobs/usage_update_export_job.rb | 2 +- app/models/affiliation_identifier.rb | 2 +- app/models/crossref.rb | 2 +- app/models/crossref_funder.rb | 2 +- app/models/crossref_import.rb | 2 +- app/models/crossref_orcid.rb | 2 +- app/models/crossref_related.rb | 2 +- app/models/funder_identifier.rb | 2 +- app/models/name_identifier.rb | 2 +- app/models/orcid_affiliation.rb | 2 +- app/models/orcid_claim.rb | 2 +- app/models/related_arxiv.rb | 2 +- app/models/related_handle.rb | 2 +- app/models/related_identifier.rb | 4 ++-- app/models/related_igsn.rb | 2 +- app/models/related_pmid.rb | 2 +- app/models/related_url.rb | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/jobs/usage_update_export_job.rb b/app/jobs/usage_update_export_job.rb index 10d694a7..2c99b847 100644 --- a/app/jobs/usage_update_export_job.rb +++ b/app/jobs/usage_update_export_job.rb @@ -9,7 +9,7 @@ def perform(item, options = {}) elsif response.status == 200 Rails.logger.info "[Event Data] #{item['subj-id']} #{item['relation-type-id']} #{item['obj-id']} pushed to Event Data service for update." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{item['subj-id']} #{item['relation-type-id']} #{item['obj-id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{item['subj-id']} #{item['relation-type-id']} #{item['obj-id']} had an error: #{response.body['errors']}" Rails.logger.error item.inspect end end diff --git a/app/models/affiliation_identifier.rb b/app/models/affiliation_identifier.rb index e89004d7..17bee5fe 100644 --- a/app/models/affiliation_identifier.rb +++ b/app/models/affiliation_identifier.rb @@ -135,7 +135,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/crossref.rb b/app/models/crossref.rb index 5925e917..90d27c0d 100644 --- a/app/models/crossref.rb +++ b/app/models/crossref.rb @@ -143,7 +143,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{item['subj_id']} #{item['relation_type_id']} #{item['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{item['subj_id']} #{item['relation_type_id']} #{item['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{item['subj_id']} #{item['relation_type_id']} #{item['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/crossref_funder.rb b/app/models/crossref_funder.rb index 38c3f222..0428ac92 100644 --- a/app/models/crossref_funder.rb +++ b/app/models/crossref_funder.rb @@ -179,7 +179,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/crossref_import.rb b/app/models/crossref_import.rb index 4aabc587..b8867402 100644 --- a/app/models/crossref_import.rb +++ b/app/models/crossref_import.rb @@ -158,7 +158,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/crossref_orcid.rb b/app/models/crossref_orcid.rb index bcf2c0ba..2f985ce8 100644 --- a/app/models/crossref_orcid.rb +++ b/app/models/crossref_orcid.rb @@ -179,7 +179,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/crossref_related.rb b/app/models/crossref_related.rb index 44e1664a..1450fd5e 100644 --- a/app/models/crossref_related.rb +++ b/app/models/crossref_related.rb @@ -205,7 +205,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/funder_identifier.rb b/app/models/funder_identifier.rb index 2c3343a9..7c884f6d 100644 --- a/app/models/funder_identifier.rb +++ b/app/models/funder_identifier.rb @@ -125,7 +125,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/name_identifier.rb b/app/models/name_identifier.rb index b166d690..a0a04092 100644 --- a/app/models/name_identifier.rb +++ b/app/models/name_identifier.rb @@ -146,7 +146,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/orcid_affiliation.rb b/app/models/orcid_affiliation.rb index 51c86d1c..0cfcb9d0 100644 --- a/app/models/orcid_affiliation.rb +++ b/app/models/orcid_affiliation.rb @@ -140,7 +140,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/orcid_claim.rb b/app/models/orcid_claim.rb index b7da37bb..19bfd76f 100644 --- a/app/models/orcid_claim.rb +++ b/app/models/orcid_claim.rb @@ -119,7 +119,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end diff --git a/app/models/related_arxiv.rb b/app/models/related_arxiv.rb index 1eddd407..7b78d391 100644 --- a/app/models/related_arxiv.rb +++ b/app/models/related_arxiv.rb @@ -121,7 +121,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" end end end diff --git a/app/models/related_handle.rb b/app/models/related_handle.rb index 8aa0e81a..b062b041 100644 --- a/app/models/related_handle.rb +++ b/app/models/related_handle.rb @@ -120,7 +120,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" end end end diff --git a/app/models/related_identifier.rb b/app/models/related_identifier.rb index 44dbd065..fa9e10af 100644 --- a/app/models/related_identifier.rb +++ b/app/models/related_identifier.rb @@ -152,7 +152,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" Rails.logger.error data.inspect end end @@ -175,7 +175,7 @@ def self.push_item(item) Rails.logger.info "[Event Data Bus] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? Rails.logger.error "[Event Data Bus] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error:" - Rails.logger.error "[Event Data Bus] #{response.body['errors'].first['title']}" + Rails.logger.error "[Event Data Bus] #{response.body['errors']}" end else Rails.logger.info "[Event Data Bus] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} was not sent to Event Data Bus." diff --git a/app/models/related_igsn.rb b/app/models/related_igsn.rb index 2d121fcd..17625192 100644 --- a/app/models/related_igsn.rb +++ b/app/models/related_igsn.rb @@ -121,7 +121,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" end end end diff --git a/app/models/related_pmid.rb b/app/models/related_pmid.rb index 70f673b1..73634e28 100644 --- a/app/models/related_pmid.rb +++ b/app/models/related_pmid.rb @@ -120,7 +120,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" end end end diff --git a/app/models/related_url.rb b/app/models/related_url.rb index 6b7ce5ef..40701355 100644 --- a/app/models/related_url.rb +++ b/app/models/related_url.rb @@ -120,7 +120,7 @@ def self.push_item(item) elsif response.status == 409 Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} already pushed to Event Data service." elsif response.body["errors"].present? - Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors'].first['title']}" + Rails.logger.info "[Event Data] #{iiitem['subj_id']} #{iiitem['relation_type_id']} #{iiitem['obj_id']} had an error: #{response.body['errors']}" end end end