diff --git a/nvchecker/source/github.py b/nvchecker/source/github.py index c1c755c..36a01c2 100644 --- a/nvchecker/source/github.py +++ b/nvchecker/source/github.py @@ -122,7 +122,8 @@ def get_next_page_url(links): def check_ratelimit(exc, name): res = exc.response - n = int(res.headers.get('X-RateLimit-Remaining')) + # default -1 is used to re-raise the exception + n = int(res.headers.get('X-RateLimit-Remaining', -1)) if n == 0: reset = int(res.headers.get('X-RateLimit-Reset')) logger.error('rate limited, resetting at %s. '