summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik George <nik@velocitux.com>2022-08-09 23:13:12 +0200
committerDominik George <nik@velocitux.com>2022-08-09 23:15:21 +0200
commit29d0e36a0c04a56d909df702b124644a55c47f06 (patch)
tree7e9ddd65be78226756666e4508e324f213f8f830
parent981c3845209a0291900b769ef52bf63edfd11494 (diff)
downloadimpressive-display-29d0e36a0c04a56d909df702b124644a55c47f06.tar.gz
impressive-display-29d0e36a0c04a56d909df702b124644a55c47f06.tar.bz2
impressive-display-29d0e36a0c04a56d909df702b124644a55c47f06.zip
Actually make curl fail on server errorsaleksis-integration
This is important in scenarios where AleKSIS, due to a race condition, references something like a stale S3 content object. impressive-display should log this and, most importantly, not try to handle the rror output as display file.
-rwxr-xr-xbin/impressive-display8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/impressive-display b/bin/impressive-display
index e8ce5a9..b07b06b 100755
--- a/bin/impressive-display
+++ b/bin/impressive-display
@@ -354,11 +354,15 @@ function download_pdffile {
NETRCFILE=" --netrc-file $workdir/secrets/${THIS_HOSTNAME}.secret"
fi
if [ "x$LOG_TO_SYSLOG" = "xyes" ]; then
- if ! curl $NETRCFILE "$pdf_uri_orig" 1> "$DOWNLOADED_FILE" 2>/dev/null; then
+ if ! curl -f $NETRCFILE "$pdf_uri_orig" 1> "$DOWNLOADED_FILE" 2>/dev/null; then
$OUTPUT "The curl tool failed in retrieving PDF file. Run this tool interactively to debug problems."
+ return
fi
else
- curl $NETRCFILE "$pdf_uri_orig" 1> "$DOWNLOADED_FILE"
+ if ! curl -f $NETRCFILE "$pdf_uri_orig" 1> "$DOWNLOADED_FILE"; then
+ $OUTPUT "The curl tool failed in retrieving PDF file."
+ return
+ fi
fi
# is the file gzipped?