Skip to content

Commit

Permalink
fix type conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaykm committed Aug 27, 2024
1 parent ccbbfa3 commit 2132792
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Downloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,13 @@ function request(
response = Response(get_response_info(easy)...)
easy.code == Curl.CURLE_OK && return response
message = get_curl_errstr(easy)
response = RequestError(url, easy.code, message, response)
if easy.code == typemax(Curl.CURLcode)
# uninitialized code, likely a protocol error
code = Int(0)
else
code = Int(easy.code)
end
response = RequestError(url, code, message, response)
throw && Base.throw(response)
end
end
Expand Down

0 comments on commit 2132792

Please sign in to comment.