Skip to content

Commit

Permalink
Report failures to download artifacts as failures (#3860)
Browse files Browse the repository at this point in the history
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 ...
```
  • Loading branch information
mbauman authored Apr 3, 2024
1 parent 2f318cf commit 8cc835c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,20 @@ function with_show_download_info(f, io, name, quiet_download)
fancyprint && print_progress_bottom(io)
printpkgstyle(io, :Downloading, "artifact: $name")
end
success = false
try
return f()
result = f()
success = result === true
return result
finally
if !quiet_download
fancyprint && print(io, "\033[1A") # move cursor up one line
fancyprint && print(io, "\033[2K") # clear line
fancyprint && printpkgstyle(io, :Downloaded, "artifact: $name")
if success
fancyprint && printpkgstyle(io, :Downloaded, "artifact: $name")
else
printpkgstyle(io, :Failure, "artifact: $name", color = :red)
end
end
end
end
Expand Down

0 comments on commit 8cc835c

Please sign in to comment.