mirror of
https://github.com/elyby/chrly.git
synced 2025-05-31 14:11:51 +05:30
#1: Add case when Mojang's API returns empty response
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user