Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.

Commit 57a0cdc

Browse files
committed
Catch errors when downloading
This fixes problems with `curl` complaining when we try to resume an old file that is longer than the new version of the file.
1 parent 898abb6 commit 57a0cdc

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/PlatformEngines.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,10 @@ function download_verify(url::AbstractString, hash::AbstractString,
479479
# Make sure the containing folder exists
480480
mkpath(dirname(dest))
481481

482-
# Download the file, optionally continuing
483-
download(url, dest; verbose=verbose)
484-
485-
# If it worked, then yay!
486482
try
483+
# Download the file, optionally continuing
484+
download(url, dest; verbose=verbose)
485+
487486
verify(dest, hash; verbose=verbose)
488487
catch e
489488
if isa(e, InterruptException)
@@ -494,10 +493,7 @@ function download_verify(url::AbstractString, hash::AbstractString,
494493
# and start over from scratch.
495494
if file_existed
496495
if verbose
497-
msg = strip("""
498-
Continued download did not yield change in file size, restarting
499-
from scratch...""")
500-
info(msg)
496+
info("Continued download didn't work, restarting from scratch")
501497
end
502498
rm(dest; force=true)
503499

0 commit comments

Comments
 (0)