Include full path in error message when failling to read cover

This commit is contained in:
Kovid Goyal 2013-11-17 08:50:05 +05:30
parent c6fda62cc7
commit bd009f3e83

View File

@ -1234,7 +1234,12 @@ class DB(object):
f = lopen(path, 'rb')
except (IOError, OSError):
time.sleep(0.2)
f = lopen(path, 'rb')
try:
f = lopen(path, 'rb')
except (IOError, OSError) as e:
# Ensure the path that caused this error is reported
raise Exception('Failed to open %r with error: %s' % (path, e))
with f:
if hasattr(dest, 'write'):
shutil.copyfileobj(f, dest)