Add title of book to error message when failing to set PDF metadata

This commit is contained in:
Kovid Goyal 2015-04-28 08:49:45 +05:30
parent 1ee5f3aba9
commit c617a95672

View File

@ -38,7 +38,7 @@ def set_metadata(stream, mi):
mi.title, mi.authors, mi.book_producer, mi.tags, xmp_packet)) mi.title, mi.authors, mi.book_producer, mi.tags, xmp_packet))
touched = result['result'] touched = result['result']
except WorkerError as e: except WorkerError as e:
raise Exception('Failed to set PDF metadata: %s'%e.orig_tb) raise Exception('Failed to set PDF metadata in (%s): %s'%(mi.title, e.orig_tb))
if touched: if touched:
with open(os.path.join(tdir, u'output.pdf'), 'rb') as f: with open(os.path.join(tdir, u'output.pdf'), 'rb') as f:
f.seek(0, 2) f.seek(0, 2)