Skip to content

Commit 7da4bd8

Browse files
committed
Error reporting fixes
1 parent 56a4438 commit 7da4bd8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/hysync/marc_synchronizer/runner.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def create_or_update_hyacinth_record(marc_record, base_digital_object_data, forc
104104
msg = 'Missing CLIO ID for marc_hyacinth_record'
105105
@errors << msg
106106
Rails.logger.error msg
107-
return
107+
return @errors.blank?, @errors
108108
end
109109

110110
if dry_run
@@ -116,10 +116,10 @@ def create_or_update_hyacinth_record(marc_record, base_digital_object_data, forc
116116
@errors << msg
117117
Rails.logger.error msg
118118
puts msg if dry_run
119-
return false, @errors
119+
return @errors.blank?, @errors
120120
end
121121

122-
return if dry_run
122+
return @errors.blank?, @errors if dry_run
123123

124124
# Add "clio#{bib_id}" identifier (e.g. clio12345).
125125
marc_hyacinth_record.digital_object_data['identifiers'] << "clio#{marc_hyacinth_record.clio_id}"
@@ -161,6 +161,8 @@ def create_or_update_hyacinth_record(marc_record, base_digital_object_data, forc
161161
@errors << msg
162162
Rails.logger.error msg
163163
end
164+
165+
return @errors.blank?, @errors
164166
end
165167

166168
# If given hyacinth_record marc_005_last_modified value is equal to given marc_record 005

0 commit comments

Comments
 (0)