From ca914ea42bd6f60fb15197035f0224afb75c975c Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Mon, 28 Nov 2022 13:11:06 +0100 Subject: [PATCH] logging improvements --- main.go | 2 +- utils/utils.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 9695b8a..db3b60e 100644 --- a/main.go +++ b/main.go @@ -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 } } diff --git a/utils/utils.go b/utils/utils.go index 28ade49..7a6bc67 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -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: