From 7c3942f9f61050f1ac291526b84d4270f6846fc1 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 20 Jul 2011 12:10:21 -0400 Subject: [PATCH] Include an ISBN in the error log if available This should help with identifying problem records. Signed-off-by: Dan Scott --- tools/ebooks/prep_ebook_records.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/ebooks/prep_ebook_records.py b/tools/ebooks/prep_ebook_records.py index b79452a47f..efe34d9f58 100644 --- a/tools/ebooks/prep_ebook_records.py +++ b/tools/ebooks/prep_ebook_records.py @@ -326,9 +326,15 @@ def process_fields(record, options): new_record.add_field(field) if not marked_isbn: - print("No matching ISBN target found in SFX for %s" % - (new_record['856']['u']) - ) + try: + isbn = record['020']['a'] + print("ISBN: [%s] - no matching ISBN target found in SFX for %s" % + (isbn, new_record['856']['u']) + ) + except: + print("No matching ISBN target found in SFX for %s" % + (new_record['856']['u']) + ) return new_record -- 2.11.0