Skip to content

Commit ba27081

Browse files
committed
Handle missing label page fetch failures as errors
1 parent a290f97 commit ba27081

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

lib/ontologies_linked_data/services/submission_process/operations/submission_missing_labels.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def handle_missing_labels(file_path, logger)
3030

3131
raw_paging = LinkedData::Models::Class.in(@submission).include(:prefLabel, :synonym, :label)
3232
loop_classes(logger, raw_paging, @submission, callbacks)
33-
rescue Exception => e
33+
rescue StandardError => e
3434
logger.error("#{e.class}: #{e.message}\n#{e.backtrace.join("\n\t")}")
3535
logger.flush
3636
@submission.add_submission_status(status.get_error_status)
@@ -46,7 +46,7 @@ def process_callbacks(logger, callbacks, action_name)
4646
yield(callable, callback)
4747
end
4848
false
49-
rescue Exception => e
49+
rescue StandardError => e
5050
logger.error("#{e.class}: #{e.message}\n#{e.backtrace.join("\n\t")}")
5151
logger.flush
5252

@@ -103,17 +103,14 @@ def loop_classes(logger, raw_paging, submission, callbacks)
103103

104104
begin
105105
t0 = Time.now
106-
page_classes = nil
107-
total_pages = 0
108-
109106
begin
110107
page_classes = paging.page(page, size).all
111108
total_pages = page_classes.total_pages
112109
page_len = page_classes.length
113110
rescue StandardError => e
114-
page_classes = []
115111
logger.error("Error retrieving page #{page} for #{acr}: #{e.class}: #{e.message}")
116112
logger.flush
113+
raise e
117114
end
118115

119116
# nothing retrieved even though we're expecting more records

0 commit comments

Comments
 (0)