Skip to content

Commit 8cc835c

Browse files
authored
Report failures to download artifacts as failures (#3860)
Previously, an artifact that failed to download might print like this: ``` (proj) pkg> instantiate Downloaded artifact: Example Downloaded artifact: Example ERROR: Unable to automatically download/install artifact 'Example' from sources listed in ... ``` With this change, that becomes: ``` (proj) pkg> instantiate Failure artifact: Example Failure artifact: Example ERROR: Unable to automatically download/install artifact 'Example' from sources listed in ... ```
1 parent 2f318cf commit 8cc835c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Artifacts.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,20 @@ function with_show_download_info(f, io, name, quiet_download)
476476
fancyprint && print_progress_bottom(io)
477477
printpkgstyle(io, :Downloading, "artifact: $name")
478478
end
479+
success = false
479480
try
480-
return f()
481+
result = f()
482+
success = result === true
483+
return result
481484
finally
482485
if !quiet_download
483486
fancyprint && print(io, "\033[1A") # move cursor up one line
484487
fancyprint && print(io, "\033[2K") # clear line
485-
fancyprint && printpkgstyle(io, :Downloaded, "artifact: $name")
488+
if success
489+
fancyprint && printpkgstyle(io, :Downloaded, "artifact: $name")
490+
else
491+
printpkgstyle(io, :Failure, "artifact: $name", color = :red)
492+
end
486493
end
487494
end
488495
end

0 commit comments

Comments
 (0)