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 @@
convertnode.terminal_output = "allatonce"
convertnode.inputs.bids_format = bids_options is not None
eg = convertnode.run()
if eg.runtime.returncode:
lgr.error(

Check warning on line 831 in heudiconv/convert.py

View check run for this annotation

Codecov / codecov/patch

heudiconv/convert.py#L831

Added line #L831 was not covered by tests
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

Check warning on line 837 in heudiconv/convert.py

View check run for this annotation

Codecov / codecov/patch

heudiconv/convert.py#L837

Added line #L837 was not covered by tests

pdb.set_trace()

Check warning on line 839 in heudiconv/convert.py

View check run for this annotation

Codecov / codecov/patch

heudiconv/convert.py#L839

Added line #L839 was not covered by tests
# TODO: make an option on behavior in such cases -- error or to continue
raise RuntimeError("Conversion has failed. Check the logs for more details")

Check warning on line 841 in heudiconv/convert.py

View check run for this annotation

Codecov / codecov/patch

heudiconv/convert.py#L841

Added line #L841 was not covered by tests
# prov information
prov_file = prefix + "_prov.ttl" if with_prov else None
if prov_file:
Expand Down