Skip to content

Commit dd47866

Browse files
authored
net.http: use error_with_code in download_file() (fix #26056) (#26057)
1 parent 76326b6 commit dd47866

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vlib/net/http/download.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn download_file(url string, out_file_path string) ! {
1313
}
1414
s := get(url) or { return err }
1515
if s.status() != .ok {
16-
return error('received http code ${s.status_code}')
16+
return error_with_code(s.body, s.status_code)
1717
}
1818
$if debug_http ? {
1919
println('http.download_file saving ${s.body.len} bytes')

0 commit comments

Comments
 (0)