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():
104104 nibabies_wf .run (** _plugin )
105105 except Exception as e :
106106 config .loggers .workflow .critical ('nibabies failed: %s' , e )
107+ exitcode = 1
107108 raise
108109 else :
109110 config .loggers .workflow .log (25 , 'nibabies finished successfully!' )
@@ -147,7 +148,7 @@ def main():
147148 add_hash = config .execution .output_layout == 'multiverse'
148149
149150 # Generate reports phase
150- generate_reports (
151+ failed_reports = generate_reports (
151152 config .execution .unique_labels ,
152153 config .execution .nibabies_dir ,
153154 config .execution .run_uuid ,
@@ -161,6 +162,16 @@ def main():
161162 )
162163 write_bidsignore (config .execution .nibabies_dir )
163164
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+
164175
165176if __name__ == '__main__' :
166177 raise RuntimeError (
You can’t perform that action at this time.
0 commit comments