Skip to content

Commit fbb13dd

Browse files
committed
fixed up error message
1 parent bfdf152 commit fbb13dd

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

pydra/engine/specs.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,11 +828,16 @@ def _from_task(cls, task: "Task[WorkflowDef]") -> Self:
828828
for node in errored:
829829
for node_task in node.errored.values():
830830
result = node_task.result()
831+
if result.errors:
832+
time_of_crash = result.errors["time of crash"]
833+
error_message = "\n".join(result.errors["error message"])
834+
else:
835+
time_of_crash = "UNKNOWN-TIME"
836+
error_message = "NOT RETRIEVED"
831837
errors.append(
832-
f"Node {node.name!r} failed @ {result.errors['time of crash']} "
833-
f"running {node._definition} with the following errors:\n"
834-
+ "\n".join(result.errors["error message"])
835-
+ "To inspect, please load the pickled task object from here: "
838+
f"Task {node.name!r} failed @ {time_of_crash} "
839+
f"running {node._definition} with the following errors:\n{error_message}"
840+
"To inspect, please load the pickled task object from here: "
836841
f"{result.output_dir}/_task.pklz"
837842
)
838843
raise RuntimeError(

pydra/engine/tests/test_task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ def Workflow(x_list):
13601360
return fun_error.out
13611361

13621362
wf = Workflow(x_list=[3, 4])
1363-
with pytest.raises(RuntimeError, match="Node 'fun_error' failed.*") as exinfo:
1363+
with pytest.raises(RuntimeError, match="Task 'fun_error' failed.*") as exinfo:
13641364
with Submitter(worker="cf", cache_dir=tmpdir) as sub:
13651365
sub(wf, raise_errors=True)
13661366

0 commit comments

Comments
 (0)