401 and 403 are forbidden and we'll delete account

This commit is contained in:
Andre Medeiros 2022-07-13 13:09:11 -04:00
parent a3e69954c8
commit aaf1fbd98a

View file

@ -178,9 +178,7 @@ func (rc *Client) doRequest(ctx context.Context, r *Request) ([]byte, *RateLimit
switch resp.StatusCode {
case 200:
return bb, rli, err
case 401:
return nil, rli, ErrInvalidBasicAuth
case 403:
case 401, 403:
return nil, rli, ErrOauthRevoked
default:
_ = rc.statsd.Incr("reddit.api.errors", r.tags, 0.1)