github-contents
github-contents copied to clipboard
Raise better exception if authentication error occurs
Got this traceback (my token was invalid):
File "...python3.9/site-packages/github_contents.py", line 51, in read_large
tree_entry = [t for t in default_tree["tree"] if t["path"] == filepath][0]
KeyError: 'tree'
Relevant code: https://github.com/simonw/github-contents/blob/c4b709a34162657f2a137e3844a114ef536b1c44/github_contents.py#L44-L53