mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2025-09-03 11:15:54 +00:00
Avoid panic after connection failure
Download function, when client.Do returns err= Nil, return false after printing the error message to avoid panic
This commit is contained in:
@@ -107,6 +107,7 @@ func Download(url string, target string, version string) bool {
|
||||
response, err := client.Do(req)
|
||||
if err != nil {
|
||||
fmt.Println("Error while downloading", url, "-", err)
|
||||
return false
|
||||
}
|
||||
defer response.Body.Close()
|
||||
c := make(chan os.Signal, 2)
|
||||
|
Reference in New Issue
Block a user