diff --git a/vlib/net/http/download.v b/vlib/net/http/download.v index 51c216cab5..18cf585ae0 100644 --- a/vlib/net/http/download.v +++ b/vlib/net/http/download.v @@ -10,6 +10,9 @@ pub fn download_file(url string, out string) ? { println('download file url=$url out=$out') } s := get(url) or { return err } + if s.status_code != 200 { + return error('received http code $s.status_code') + } os.write_file(out, s.text) ? // download_file_with_progress(url, out, empty, empty) }