Skip to content

Commit

Permalink
log输出更多有效信息
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcium-Ion committed Dec 20, 2023
1 parent 5730c69 commit f5a36a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func ValidateUserToken(key string) (token *Token, err error) {
token, err = CacheGetTokenByKey(key)
if err == nil {
if token.Status == common.TokenStatusExhausted {
return nil, errors.New("该令牌额度已用尽")
return nil, errors.New("该令牌额度已用尽 token.Status == common.TokenStatusExhausted " + key)
} else if token.Status == common.TokenStatusExpired {
return nil, errors.New("该令牌已过期")
}
Expand All @@ -71,7 +71,7 @@ func ValidateUserToken(key string) (token *Token, err error) {
common.SysError("failed to update token status" + err.Error())
}
}
return nil, errors.New("该令牌额度已用尽")
return nil, errors.New(fmt.Sprintf("%s 该令牌额度已用尽 !token.UnlimitedQuota && token.RemainQuota = %d", token.Key, token.RemainQuota))
}
return token, nil
}
Expand Down

0 comments on commit f5a36a0

Please sign in to comment.