From: Dan Scott Date: Wed, 20 Jul 2011 16:10:21 +0000 (-0400) Subject: Include an ISBN in the error log if available X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7c3942f9f61050f1ac291526b84d4270f6846fc1;p=contrib%2FConifer.git Include an ISBN in the error log if available This should help with identifying problem records. Signed-off-by: Dan Scott --- 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