#1: Handle Mojang's server errors too

This commit is contained in:
ErickSkrauch
2019-04-20 23:04:29 +03:00
parent c2921400b0
commit a8bbacf8b1
4 changed files with 91 additions and 7 deletions

View File

@@ -101,7 +101,7 @@ func (ctx *JobsQueue) queueRound() {
profiles, err := usernamesToUuids(usernames)
switch err.(type) {
case *mojang.TooManyRequestsError:
case *mojang.TooManyRequestsError, *mojang.ServerError:
for _, job := range jobs {
job.RespondTo <- nil
}
@@ -147,8 +147,7 @@ func (ctx *JobsQueue) getTextures(uuid string) *mojang.SignedTexturesResponse {
shouldCache := true
result, err := uuidToTextures(uuid, true)
switch err.(type) {
case *mojang.EmptyResponse:
case *mojang.TooManyRequestsError:
case *mojang.EmptyResponse, *mojang.TooManyRequestsError, *mojang.ServerError:
shouldCache = false
case error:
panic(err)