Skip to content

Commit

Permalink
fix: capture result for error reporting (#78)
Browse files Browse the repository at this point in the history
we can't do anything if `fastq-dump` returns error code 3, so just stop
executing.

Capture `result` in case we see an empty file to better deal with other
errors.

Part of #76
  • Loading branch information
luizirber authored Feb 5, 2025
1 parent 7f1ca94 commit 70bd1eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wort/blueprints/compute/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ def compute(sra_id):
except CalledProcessError as e:
if e.returncode == 3:
# Happens when fastq-dump can't find an accession
# (might have been removed, redacted, or never uploaded)
pass
# (might have been removed, redacted, or never uploaded,
# and in some cases need dbGaP permission, like SRR27017016)
# stop further processing.
return

# We ignore SIGPIPE, since it is informational (and makes sense,
# it happens because `head` is closed and `fastq-dump` can't pipe
# its output anymore. More details:
# http://www.pixelbeat.org/programming/sigpipe_handling.html
elif e.returncode != 141:
raise e
else:
result = result

# if file is empty, consider it an error and sift
# through logs later to figure out better error control
Expand Down

0 comments on commit 70bd1eb

Please sign in to comment.