cli: handle failed update checks gracefully (close #5392) (#5403)

This commit is contained in:
Aravind 2020-07-27 07:15:08 +05:30 committed by GitHub
parent 0ae5384115
commit 2e5e59bd00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,9 @@ func getLatestVersion() (*semver.Version, *semver.Version, error) {
if err != nil { if err != nil {
return nil, nil, errors.Wrap(err, "decoding update check response") return nil, nil, errors.Wrap(err, "decoding update check response")
} }
if response.Latest == nil && response.PreRelease == nil {
return nil,nil, fmt.Errorf("expected version info not found at %s", updateCheckURL)
}
return response.Latest, response.PreRelease, nil return response.Latest, response.PreRelease, nil
} }