Device drivers: Ignore corrupted metadata.calibre, instead of raising an error

This commit is contained in:
Kovid Goyal 2012-09-05 09:28:06 +05:30
parent 6ec107a928
commit 206af4c041
2 changed files with 4 additions and 2 deletions

View File

@ -161,7 +161,9 @@ class JsonCodec(object):
try: try:
js = json.load(file_, encoding='utf-8') js = json.load(file_, encoding='utf-8')
for item in js: for item in js:
booklist.append(self.raw_to_book(item, book_class, prefix)) entry = self.raw_to_book(item, book_class, prefix)
if entry is not None:
booklist.append(entry)
except: except:
print 'exception during JSON decode_from_file' print 'exception during JSON decode_from_file'
traceback.print_exc() traceback.print_exc()