Improve error message printing and suppression. (#2104)

This commit is contained in:
Robert Nishihara
2018-05-20 12:13:14 -07:00
committed by Philipp Moritz
parent f37e2e5d2f
commit 99ae74e1d2
3 changed files with 32 additions and 18 deletions
+4 -4
View File
@@ -38,10 +38,10 @@ def format_error_message(exception_message, task_exception=False):
"""
lines = exception_message.split("\n")
if task_exception:
# For errors that occur inside of tasks, remove lines 1, 2, 3, and 4,
# which are always the same, they just contain information about the
# main loop.
lines = lines[0:1] + lines[5:]
# For errors that occur inside of tasks, remove lines 1 and 2 which are
# always the same, they just contain information about the worker code.
lines = lines[0:1] + lines[3:]
pass
return "\n".join(lines)