Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: raise exception if dcm2niix returns with non-0 code #695

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions heudiconv/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,18 @@ def nipype_convert(
convertnode.terminal_output = "allatonce"
convertnode.inputs.bids_format = bids_options is not None
eg = convertnode.run()
if eg.runtime.returncode:
lgr.error(
f"Conversion has failed with exit code {eg.runtime.returncode}.\n"
f" Produced files: {eg.outputs.converted_files}\n"
f" stdout: {eg.runtime.stdout}\n"
f" stderr: {eg.runtime.stderr}"
)
import pdb

pdb.set_trace()
# TODO: make an option on behavior in such cases -- error or to continue
raise RuntimeError("Conversion has failed. Check the logs for more details")
# prov information
prov_file = prefix + "_prov.ttl" if with_prov else None
if prov_file:
Expand Down