mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54: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):
|
def __init__(self, tb, msg=None):
|
||||||
Exception.__init__(self, msg or _('Failed to get completion data'))
|
Exception.__init__(self, msg or _('Failed to get completion data'))
|
||||||
self.tb = tb
|
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.constants import iswindows
|
||||||
from calibre.gui2.tweak_book.completion.basic import Request
|
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
|
from calibre.utils.ipc import eintr_retry_call
|
||||||
|
|
||||||
COMPLETION_REQUEST = 'completion request'
|
COMPLETION_REQUEST = 'completion request'
|
||||||
@ -179,6 +180,8 @@ def main(control_conn, data_conn):
|
|||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
ans, tb = handle_control_request(request, data_conn), None
|
ans, tb = handle_control_request(request, data_conn), None
|
||||||
|
except DataError as err:
|
||||||
|
ans, tb = None, err.traceback()
|
||||||
except Exception:
|
except Exception:
|
||||||
import traceback
|
import traceback
|
||||||
ans, tb = None, traceback.format_exc()
|
ans, tb = None, traceback.format_exc()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user