351ed2fc24a13b86cf2a1fc9695309e2c0da9de5
lrnassar
  Wed Jun 3 09:33:28 2026 -0700
Make otto fetch failures loud and clinGen silent on no-update. refs #37697

Several otto jobs used 'wget -q'/'curl -s' under 'set -e', so a broken download
aborted with no output and cron (which mails on output, not exit code) sent nothing
-- the mode by which mastermind failed silently for months.

- mastermind, malacards: add an ERR trap that echoes a failure message; switch
mastermind's 'curl -s' to 'curl -sf' so an HTTP error fails loudly instead of
writing a challenge page into the release file.
- geneReviews: add an ERR trap (kept silent on no-update via the wrapper's mail -E).
- All three use 'set -eE' (errtrace) so the ERR trap also fires for failures inside
functions/subshells, not just top-level commands.
- clinGen: capture each sub-build's exit status instead of swallowing it under
'set +e', and report which sub-build failed. Also drop the routine 'No ... update'
echoes and the unconditional 'ClinGen update done.' line, and switch the wrapper to
'mail -E', so clinGen is now silent on no-update and only emails on a real update
or a failure.

diff --git src/hg/utils/otto/clinGen/checkClinGen.sh src/hg/utils/otto/clinGen/checkClinGen.sh
index e6d32ec778d..056f72d77ba 100755
--- src/hg/utils/otto/clinGen/checkClinGen.sh
+++ src/hg/utils/otto/clinGen/checkClinGen.sh
@@ -18,22 +18,28 @@
 umask 002
 
 # this is where we are going to work
 if [ ! -d "${WORKDIR}" ]; then
     printf "ERROR in ClinGen build, can not find the directory: %s\n" "${WORKDIR}"
     exit 255
 fi
 
 # setup the release directory, which holds all the current bigBeds:
 mkdir -p ${WORKDIR}/release/{hg19,hg38}
 
 # There are multiple parts to this otto job, each one runs separately and does it's own
 # checking for updated files and stuff. Each downloads data from a separate website which
 # can go down so don't force the others to die just because one is having a problem.
 set +e
-./makeCnv.sh ${WORKDIR}
-./makeDosage.sh ${WORKDIR}
-#./makeEvRepo.sh ${WORKDIR}
-./makeGeneValidity.sh ${WORKDIR}
+failed=""
+./makeCnv.sh ${WORKDIR}          || failed="$failed makeCnv"
+./makeDosage.sh ${WORKDIR}       || failed="$failed makeDosage"
+#./makeEvRepo.sh ${WORKDIR}      || failed="$failed makeEvRepo"
+./makeGeneValidity.sh ${WORKDIR} || failed="$failed makeGeneValidity"
 set -e
 
-echo "ClinGen update done."
+# Each sub-build is silent on no-update, so a clean run with nothing to do produces no
+# output and the wrapper's mail stays silent. Report any sub-build that failed.
+if [ -n "$failed" ]; then
+    echo "ERROR: ClinGen sub-build(s) failed:$failed"
+    exit 1
+fi