Log backend exceptions while in the thread for better info
Fixes
@@ -90,6 +90,7 @@ def get_lint_tasks(linters, view, view_has_changed):
def execute_lint_task(linter, code, offset, view_has_changed, settings, task_name):
+ try:
# We 'name' our threads, for logging purposes.
threading.current_thread().name = task_name
@@ -97,6 +98,10 @@ def execute_lint_task(linter, code, offset, view_has_changed, settings, task_nam
translate_lineno_and_column(errors, offset)
return errors
+ except BaseException:
+ # Log while multi-threaded to get a nicer log message
+ logger.exception('Linter crashed.\n\n')
+ raise
def translate_lineno_and_column(errors, offset):
@@ -212,4 +217,4 @@ def await_futures(fs, ordered=False):
try:
yield future.result()
except Exception:
- logger.exception('Lint task failed.')
+ ...
