Unverified Commit 817fc356 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

fix dict access error


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 69017ff9
Pipeline #22558 passed with stages
in 1 minute and 43 seconds
......@@ -96,7 +96,7 @@ class RecordProcessor:
logging.error("Indexing failed. Aborting...")
for key in self.processed_records.keys():
self.reporter.send_message(key, 'FATAL', f'Indexing failed: {ex}',
self.processed_records['headers'])
self.processed_records[key]['headers'])
def index(self):
for key in self.processed_records.keys():
......@@ -131,17 +131,17 @@ class RecordProcessor:
('DIGITAL OBJECT: {} -- THUMBNAIL: {}' +
' -- AUDIO SNIPPET: {}').format(
dig_obj_msg, thumbnail_msg, audio_snip_msg
), self.processed_records['headers'])
), record['headers'])
elif ok:
self.indexer.commit()
self.reporter.send_message(key, 'FATAL',
('DIGITAL OBJECT: {} -- THUMBNAIL: {} ' +
'-- AUDIO SNIPPET: {}')
.format(dig_obj_msg, thumbnail_msg, audio_snip_msg),
self.processed_records['headers'])
record['headers'])
else:
self.indexer.rollback()
self.reporter.send_message(key, 'FATAL',
f'Indexing failed: {err_msg}',
self.processed_records['headers'])
record['headers'])
self.processed_records.clear()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment