Skip to content

Commit e66fd05

Browse files
committed
fix: correct the logging of errors in report generation
1 parent 42ec59f commit e66fd05

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

fmriprep/reports/core.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def generate_reports(subject_list, output_dir, run_uuid, config=None, work_dir=N
3131
if work_dir is not None:
3232
reportlets_dir = Path(work_dir) / "reportlets"
3333

34-
report_errors = []
34+
error_list = ""
3535
for subject_label in subject_list:
3636
entities = {}
3737
entities["subject"] = subject_label
@@ -53,17 +53,14 @@ def generate_reports(subject_list, output_dir, run_uuid, config=None, work_dir=N
5353
robj.generate_report()
5454
except:
5555
errno += 1
56+
error_list = error_list + f"{subject_label}, "
5657

5758
if errno:
5859
import logging
5960

6061
logger = logging.getLogger("cli")
61-
error_list = ", ".join(
62-
f"{subid} ({err})" for subid, err in zip(subject_list, report_errors) if err
63-
)
64-
logger.error(
65-
"Preprocessing did not finish successfully. Errors occurred while processing "
66-
"data from participants: %s. Check the HTML reports for details.",
62+
logger.debug(
63+
"Report generation was not successful for the following participants : %s.",
6764
error_list,
6865
)
6966
return errno

0 commit comments

Comments
 (0)