mirror of
https://github.com/grafana/grafana.git
synced 2025-01-07 22:53:56 -06:00
feat(cli): improves defer error handling
This commit is contained in:
parent
70acfb2cfd
commit
0855f51436
@ -127,15 +127,15 @@ func downloadFile(pluginName, filePath, url string) (err error) {
|
||||
if r := recover(); r != nil {
|
||||
retryCount++
|
||||
if retryCount < 3 {
|
||||
|
||||
fmt.Println("Failed downloading. Will retry once.")
|
||||
downloadFile(pluginName, filePath, url)
|
||||
err = downloadFile(pluginName, filePath, url)
|
||||
} else {
|
||||
failure := fmt.Sprintf("%v", r)
|
||||
if failure == "runtime error: makeslice: len out of range" {
|
||||
log.Errorf("Failed to extract zipped HTTP response. Please try again.\n")
|
||||
err = fmt.Errorf("Failed to extract zipped HTTP response. Please try again.\n")
|
||||
} else {
|
||||
panic(r)
|
||||
}
|
||||
panic(r)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user