Skip to content

Commit c34ec3e

Browse files
authored
Add a status_ok(response::Response) method (#199)
1 parent 78255d4 commit c34ec3e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Downloads.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ struct Response
9797
headers :: Vector{Pair{String,String}}
9898
end
9999

100+
Curl.status_ok(response::Response) = status_ok(response.proto, response.status)
101+
100102
"""
101103
struct RequestError <: ErrorException
102104
url :: String
@@ -239,7 +241,7 @@ function download(
239241
debug = debug,
240242
downloader = downloader,
241243
)::Response
242-
status_ok(response.proto, response.status) && return output
244+
status_ok(response) && return output
243245
throw(RequestError(url, Curl.CURLE_OK, "", response))
244246
end
245247
end

0 commit comments

Comments
 (0)