github-contents icon indicating copy to clipboard operation
github-contents copied to clipboard

Raise better exception if authentication error occurs

Open simonw opened this issue 3 years ago • 0 comments

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

simonw avatar Feb 24 '21 18:02 simonw