Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture more errors in LoadUrnsJob to avoid "false positive" harvest reporting #40

Merged
merged 2 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ GIT
PATH
remote: .
specs:
spotlight-oaipmh-resources (3.0.0.pre.beta.9)
spotlight-oaipmh-resources (3.0.0.pre.beta.10)
mods
oai

Expand Down
11 changes: 8 additions & 3 deletions app/jobs/spotlight/resources/load_urns_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def perform(job_tracker:, sidecar_ids:, exhibit:, user: nil)
#
# https://getbootstrap.com/docs/4.0/content/tables/
message = "Missing Spotlight::SolrDocumentSidecar for document_id=#{sidecar_id}"
job_tracker&.append_log_entry(type: :warning, exhibit: exhibit, message: message)
job_tracker.append_log_entry(type: :warning, exhibit: exhibit, message: message)
total_warnings += 1
next
end
Expand All @@ -33,10 +33,15 @@ def perform(job_tracker:, sidecar_ids:, exhibit:, user: nil)
#
# https://getbootstrap.com/docs/4.0/content/tables/
message = "Invalid data for Spotlight::SolrDocumentSidecar for document_id=#{sidecar_id}"
job_tracker&.append_log_entry(type: :warning, exhibit: exhibit, message: message)
job_tracker&.append_log_entry(type: :warning, exhibit: exhibit, message: e.message)
job_tracker.append_log_entry(type: :warning, exhibit: exhibit, message: message)
job_tracker.append_log_entry(type: :warning, exhibit: exhibit, message: e.message)
total_warnings += 1
end
rescue StandardError => e
message = "An error has occurred when trying to index the URN for document_id=#{sidecar_id}"
job_tracker.append_log_entry(type: :warning, exhibit: exhibit, message: message)
job_tracker.append_log_entry(type: :warning, exhibit: exhibit, message: %(#{e.class}: #{e.message}))
total_warnings += 1
end
total_warnings
end
Expand Down
2 changes: 1 addition & 1 deletion lib/spotlight/oaipmh/resources/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Spotlight
module Oaipmh
# :nodoc:
module Resources
VERSION = "3.0.0-beta.9"
VERSION = "3.0.0-beta.10"
end
end
end