Skip to content

Commit

Permalink
Print a root-cause exception for DependencyError
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Dec 4, 2024
1 parent 76e5328 commit ce429bb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions parsl/dataflow/errors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import traceback
from typing import Optional, Sequence, Tuple

from parsl.errors import ParslError
Expand Down Expand Up @@ -48,8 +49,12 @@ def __init__(self, dependent_exceptions_tids: Sequence[Tuple[Exception, str]], t
self.task_id = task_id

def __str__(self) -> str:
deps = ", ".join(tid for _exc, tid in self.dependent_exceptions_tids)
return f"Dependency failure for task {self.task_id} with failed dependencies from {deps}"
e: Exception = self
dep_ids = []
while isinstance(e, DependencyError) and len(e.dependent_exceptions_tids) >= 1:
dep_ids.append(e.dependent_exceptions_tids[0][1])
e = e.dependent_exceptions_tids[0][0]
return f"Dependency failure for task {self.task_id}, caused (via {' <- '.join(dep_ids)}) by: \n{''.join(traceback.format_exception(e))}"


class JoinError(DataFlowException):
Expand Down

0 comments on commit ce429bb

Please sign in to comment.