mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Better error message when viewing corrupted epub files
This commit is contained in:
parent
8bb3c0a745
commit
3d15f57526
@ -28,6 +28,7 @@ from calibre.customize.ui import available_input_formats
|
|||||||
from calibre.gui2.viewer.dictionary import Lookup
|
from calibre.gui2.viewer.dictionary import Lookup
|
||||||
from calibre import as_unicode, force_unicode, isbytestring
|
from calibre import as_unicode, force_unicode, isbytestring
|
||||||
from calibre.ptempfile import reset_base_dir
|
from calibre.ptempfile import reset_base_dir
|
||||||
|
from calibre.utils.zipfile import BadZipfile
|
||||||
|
|
||||||
vprefs = JSONConfig('viewer')
|
vprefs = JSONConfig('viewer')
|
||||||
|
|
||||||
@ -37,6 +38,11 @@ class Worker(Thread):
|
|||||||
try:
|
try:
|
||||||
Thread.run(self)
|
Thread.run(self)
|
||||||
self.exception = self.traceback = None
|
self.exception = self.traceback = None
|
||||||
|
except BadZipfile:
|
||||||
|
self.exception = _(
|
||||||
|
'This ebook is corrupted and cannot be opened. If you '
|
||||||
|
'downloaded it from somewhere, try downloading it again.')
|
||||||
|
self.traceback = ''
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.exception = err
|
self.exception = err
|
||||||
self.traceback = traceback.format_exc()
|
self.traceback = traceback.format_exc()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user