#1: Add case when Mojang's API returns empty response

This commit is contained in:
ErickSkrauch
2019-04-20 22:39:17 +03:00
parent e7c0fac346
commit c2921400b0
4 changed files with 78 additions and 13 deletions

View File

@@ -146,12 +146,12 @@ func (ctx *JobsQueue) getTextures(uuid string) *mojang.SignedTexturesResponse {
shouldCache := true
result, err := uuidToTextures(uuid, true)
if err != nil {
if _, ok := err.(*mojang.TooManyRequestsError); !ok {
panic(err)
}
switch err.(type) {
case *mojang.EmptyResponse:
case *mojang.TooManyRequestsError:
shouldCache = false
case error:
panic(err)
}
if shouldCache && result != nil {