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 continue
default: 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 continue
} }
} }

View File

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