diff --git a/src/calibre/gui2/tweak_book/completion/utils.py b/src/calibre/gui2/tweak_book/completion/utils.py index a1687a8116..919269df4e 100644 --- a/src/calibre/gui2/tweak_book/completion/utils.py +++ b/src/calibre/gui2/tweak_book/completion/utils.py @@ -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 diff --git a/src/calibre/gui2/tweak_book/completion/worker.py b/src/calibre/gui2/tweak_book/completion/worker.py index d97f74a75a..84a8569031 100644 --- a/src/calibre/gui2/tweak_book/completion/worker.py +++ b/src/calibre/gui2/tweak_book/completion/worker.py @@ -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()