File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ def main():
104
104
nibabies_wf .run (** _plugin )
105
105
except Exception as e :
106
106
config .loggers .workflow .critical ('nibabies failed: %s' , e )
107
+ exitcode = 1
107
108
raise
108
109
else :
109
110
config .loggers .workflow .log (25 , 'nibabies finished successfully!' )
@@ -147,7 +148,7 @@ def main():
147
148
add_hash = config .execution .output_layout == 'multiverse'
148
149
149
150
# Generate reports phase
150
- generate_reports (
151
+ failed_reports = generate_reports (
151
152
config .execution .unique_labels ,
152
153
config .execution .nibabies_dir ,
153
154
config .execution .run_uuid ,
@@ -161,6 +162,16 @@ def main():
161
162
)
162
163
write_bidsignore (config .execution .nibabies_dir )
163
164
165
+ if failed_reports :
166
+ msg = (
167
+ 'Report generation was not successful for the following participants '
168
+ f': { ", " .join (failed_reports )} .'
169
+ )
170
+ config .loggers .cli .error (msg )
171
+
172
+ if int (exitcode ) or failed_reports :
173
+ sys .exit (1 )
174
+
164
175
165
176
if __name__ == '__main__' :
166
177
raise RuntimeError (
You can’t perform that action at this time.
0 commit comments