epogrebnyak / ssg-dataset

Open reproducible dataset on static site generators (SSG) popularity.
https://ssg-dataset.streamlit.app
GNU General Public License v3.0
28 stars 47 forks source link

explicitly fail when not authenticated and rate limit exceeded #25

Closed epogrebnyak closed 1 year ago

epogrebnyak commented 2 years ago

https://github.com/epogrebnyak/ssg-dataset/blob/8c12f0ce2b5f713001b7e26ad3eff7023b74a636/src/ssg/github.py#L47-L48

from ssg.github import get_repo
get_repo("bridgetownrb/bridgetown")
{'message': "API rate limit exceeded for 52.233.193.11. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", 'documentation_url': 'https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting'}
epogrebnyak commented 2 years ago

Currently the error shown is:

  File "/workspaces/ssg-dataset/src/ssg/github.py", line 115, in get_repo_state_from_handle
    repo_lang=repo["language"],
KeyError: 'language'

and it is not clear that the problem was rate limit.

epogrebnyak commented 2 years ago

To reproduce - run exaple/update.py without GH_TOKEN.