Fix error in downloadImage()

This commit is contained in:
Yang Luo
2023-06-19 17:52:01 +08:00
parent 58aa7dba6a
commit d9c4f401e3

View File

@ -34,7 +34,7 @@ func downloadImage(client *http.Client, url string) (*bytes.Buffer, string, erro
resp, err := client.Do(req) resp, err := client.Do(req)
if err != nil { if err != nil {
fmt.Printf("downloadImage() error for url [%s]: %s\n", url, err.Error()) fmt.Printf("downloadImage() error for url [%s]: %s\n", url, err.Error())
if strings.Contains(err.Error(), "EOF") { if strings.Contains(err.Error(), "EOF") || strings.Contains(err.Error(), "no such host") {
return nil, "", nil return nil, "", nil
} else { } else {
return nil, "", err return nil, "", err