logging improvements

This commit is contained in:
2022-11-28 13:11:06 +01:00
parent d856b32139
commit ca914ea42b
2 changed files with 4 additions and 3 deletions

View File

@@ -238,7 +238,7 @@ func housekeeping() {
}
continue
default:
log.Warningf("[HK] Error while requesting sharecodes for %d: %v", tPlayer.ID, err)
log.Infof("[HK] Unable to request sharecodes for %d: %v", tPlayer.ID, err)
continue
}
}

View File

@@ -219,7 +219,8 @@ type MatchResponse struct {
var (
ErrorSharecodeNoMatch = errors.New("sharecode not provided")
ErrorAuthcodeRateLimit = errors.New("temporary rate-limited/unavailable")
ErrorAuthcodeRateLimit = errors.New("temporary rate-limited")
ErrorAuthcodeUnavailable = errors.New("temporary unavailable")
ErrorAuthcodeUnauthorized = errors.New("authcode unauthorized")
ErrorNoMatch = errors.New("no match found")
)
@@ -565,7 +566,7 @@ func getNextShareCode(lastCode, apiKey, authCode string, steamID uint64, rl *rat
case http.StatusTooManyRequests:
return nil, ErrorAuthcodeRateLimit
case http.StatusServiceUnavailable:
return nil, ErrorAuthcodeRateLimit
return nil, ErrorAuthcodeUnavailable
case http.StatusPreconditionFailed:
return nil, ErrorSharecodeNoMatch
case http.StatusForbidden: