mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Pass through tracebacks that occur while getting data
This commit is contained in:
parent
2309a0cca5
commit
b8becfa1dd
@ -21,3 +21,6 @@ class DataError(Exception):
|
||||
def __init__(self, tb, msg=None):
|
||||
Exception.__init__(self, msg or _('Failed to get completion data'))
|
||||
self.tb = tb
|
||||
|
||||
def traceback(self):
|
||||
return unicode(self) + '\n' + self.tb
|
||||
|
@ -14,6 +14,7 @@ from collections import namedtuple
|
||||
|
||||
from calibre.constants import iswindows
|
||||
from calibre.gui2.tweak_book.completion.basic import Request
|
||||
from calibre.gui2.tweak_book.completion.utils import DataError
|
||||
from calibre.utils.ipc import eintr_retry_call
|
||||
|
||||
COMPLETION_REQUEST = 'completion request'
|
||||
@ -179,6 +180,8 @@ def main(control_conn, data_conn):
|
||||
break
|
||||
try:
|
||||
ans, tb = handle_control_request(request, data_conn), None
|
||||
except DataError as err:
|
||||
ans, tb = None, err.traceback()
|
||||
except Exception:
|
||||
import traceback
|
||||
ans, tb = None, traceback.format_exc()
|
||||
|
Loading…
x
Reference in New Issue
Block a user