Skip to content

Commit bed65aa

Browse files
oestebaneffigies
andauthored
Update nipype/pipeline/plugins/linear.py
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent 1833a12 commit bed65aa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nipype/pipeline/plugins/linear.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,12 @@ def run(self, graph, config, updatehash=False):
6868
os.chdir(old_wd) # Return wherever we were before
6969
report_nodes_not_run(notrun)
7070
if errors:
71-
# Re-raise exception of first failed node
72-
raise errors[0]
71+
# If one or more nodes failed, re-rise first of them
72+
error, cause = errors[0], None
73+
if isinstance(error, str):
74+
error = RuntimeError(error)
75+
76+
if len(errors) > 1:
77+
error, cause = RuntimeError(f"{len(errors)} raised. Re-raising first."), error
78+
79+
raise error from cause

0 commit comments

Comments
 (0)