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') f = lopen(path, 'rb')
except (IOError, OSError): except (IOError, OSError):
time.sleep(0.2) 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: with f:
if hasattr(dest, 'write'): if hasattr(dest, 'write'):
shutil.copyfileobj(f, dest) shutil.copyfileobj(f, dest)