improved error messages

This commit is contained in:
2021-11-04 20:41:31 +01:00
parent 491abc2869
commit 7785135d7c

View File

@@ -501,8 +501,10 @@ func getNextShareCode(lastCode string, apiKey string, authCode string, steamId u
switch r.StatusCode {
case http.StatusAccepted:
return "n/a", nil
case http.StatusTooManyRequests, http.StatusServiceUnavailable:
return "", AuthcodeRateLimitError{errors.New("api temp. ratelimited")}
case http.StatusTooManyRequests:
return "", AuthcodeRateLimitError{errors.New("temporary ratelimited")}
case http.StatusServiceUnavailable:
return "", AuthcodeRateLimitError{errors.New("temporary unavailable")}
case http.StatusPreconditionFailed:
return "", SharecodeNoMatchError{errors.New("sharecode not from player history")}
case http.StatusForbidden: