handle error

This commit is contained in:
Kirill Zhuravlev 2023-02-15 04:11:17 +01:00 committed by Avelino
parent 5a7a10e3f4
commit 105035402b
No known key found for this signature in database
GPG Key ID: B345B4D52E98180A

View File

@ -177,7 +177,10 @@ func testRepoState(toRun bool, href string, client *http.Client, staleRepos *[]s
defer resp.Body.Close()
var repoResp repo
json.NewDecoder(resp.Body).Decode(&repoResp)
if err := json.NewDecoder(resp.Body).Decode(&repoResp); err != nil {
return false
}
isRepoAdded := false
if resp.StatusCode == http.StatusMovedPermanently {