Возвращаем ошибку, если не удалось раскодировать JSON с информацией о скине из Redis

This commit is contained in:
ErickSkrauch 2017-09-29 13:59:29 +03:00
parent 378643623b
commit 20b8e8da86
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E

View File

@ -114,15 +114,13 @@ func (db *redisDb) FindByUsername(username string) (*model.Skin, error) {
result, err := zlibDecode(encodedResult) result, err := zlibDecode(encodedResult)
if err != nil { if err != nil {
log.Println("Cannot uncompress zlib for key " + redisKey) // TODO: replace with valid error
return nil, err return nil, err
} }
var skin *model.Skin var skin *model.Skin
err = json.Unmarshal(result, &skin) err = json.Unmarshal(result, &skin)
if err != nil { if err != nil {
log.Println("Cannot decode record data for key" + redisKey) // TODO: replace with valid error return nil, err
return nil, nil
} }
skin.OldUsername = skin.Username skin.OldUsername = skin.Username