mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 15:13:41 +02:00
Better error message when viewing corrupted epub files
This commit is contained in:
parent
8bb3c0a745
commit
3d15f57526
1 changed files with 6 additions and 0 deletions
|
|
@ -28,6 +28,7 @@
|
|||
from calibre.gui2.viewer.dictionary import Lookup
|
||||
from calibre import as_unicode, force_unicode, isbytestring
|
||||
from calibre.ptempfile import reset_base_dir
|
||||
from calibre.utils.zipfile import BadZipfile
|
||||
|
||||
vprefs = JSONConfig('viewer')
|
||||
|
||||
|
|
@ -37,6 +38,11 @@ def run(self):
|
|||
try:
|
||||
Thread.run(self)
|
||||
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:
|
||||
self.exception = err
|
||||
self.traceback = traceback.format_exc()
|
||||
|
|
|
|||
Loading…
Reference in a new issue