Skip to content

Commit

Permalink
Capture curl download agent error message (JuliaLang#31209)
Browse files Browse the repository at this point in the history
  • Loading branch information
musm authored and StefanKarpinski committed Mar 12, 2019
1 parent 48e7a35 commit d7fdd75
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions base/download.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ function find_curl()
end
end

function download_curl(curl_exe, url, filename)
run(`$curl_exe -s -S -g -L -f -o $filename $url`)
function download_curl(curl_exe::AbstractString, url::AbstractString, filename::AbstractString)
err = PipeBuffer()
process = run(pipeline(`$curl_exe -s -S -g -L -f -o $filename $url`, stderr=err), wait=false)
if !success(process)
stderr = readline(err)
error(stderr)
end
return filename
end

Expand Down

0 comments on commit d7fdd75

Please sign in to comment.